qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Bharata B Rao <bharata@linux.vnet.ibm.com>
To: David Gibson <david@gibson.dropbear.id.au>
Cc: thuth@redhat.com, ehabkost@redhat.com, armbru@redhat.com,
	agraf@suse.de, qemu-devel@nongnu.org, qemu-ppc@nongnu.org,
	pbonzini@redhat.com, imammedo@redhat.com,
	"Andreas Färber" <afaerber@suse.de>
Subject: Re: [Qemu-devel] CPU hotplug, again
Date: Tue, 23 Feb 2016 15:19:11 +0530	[thread overview]
Message-ID: <20160223094911.GB21081@in.ibm.com> (raw)
In-Reply-To: <20160223094026.GA21081@in.ibm.com>

On Tue, Feb 23, 2016 at 03:10:26PM +0530, Bharata B Rao wrote:
> 
> 5) QOM-links
> 
> Andreas, You have often talked about setting up links from machine object
> to the CPU objects. Would the below code correctly capture that idea of
> yours ?
> 
> #define SPAPR_MACHINE_CPU_CORE_PROP "core"
> 
> /* MachineClass.init for sPAPR */
> static void ppc_spapr_init(MachineState *machine)
> {
>     sPAPRMachineState *spapr = SPAPR_MACHINE(machine);
>     int spapr_smp_cores = smp_cpus / smp_threads;
>     int spapr_max_cores = max_cpus / smp_threads;
> 
>     ...
>     for (i = 0; i < spapr_max_cores; i++) {
>         Object *obj = object_new(TYPE_SPAPR_CPU_CORE);
>         sPAPRCPUCore *core = SPAPR_CPU_CORE(obj);
>         char name[32];
> 
>         snprintf(name, sizeof(name), "%s[%d]", SPAPR_MACHINE_CPU_CORE_PROP, i);
> 
>         /*
>          * Create links from machine objects to all possible cores.
>          */
>         object_property_add_link(OBJECT(spapr), name, TYPE_SPAPR_CPU_CORE,
>                                  (Object **)&spapr->core[i],
>                                  NULL, NULL, &error_abort); 
> 
>         /*
>          * Set the QOM link from machine object to core object for all
>          * boot time CPUs specified with -smp. For rest of the hotpluggable
>          * cores this is done from the core hotplug path.
>          */
>         if (i < spapr_smp_cores) {
>             object_property_set_link(OBJECT(spapr), OBJECT(core),
>                                      SPAPR_MACHINE_CPU_CORE_PROP, &error_abort);
>         }

BTW s/SPAPR_MACHINE_CPU_CORE_PROP/name in object_property_set_link() above.

  reply	other threads:[~2016-02-23 10:07 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-23  5:24 [Qemu-devel] CPU hotplug, again David Gibson
2016-02-23  9:40 ` Bharata B Rao
2016-02-23  9:49   ` Bharata B Rao [this message]
2016-02-23 10:05   ` David Gibson
2016-02-23 11:18     ` Igor Mammedov
2016-02-24  2:01       ` David Gibson
2016-02-24  4:02         ` Bharata B Rao
2016-02-24 10:48         ` Igor Mammedov
2016-02-24 11:28           ` David Gibson
2016-02-24 13:41             ` Igor Mammedov
2016-02-25  6:41               ` David Gibson
2016-02-25 13:29                 ` Igor Mammedov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160223094911.GB21081@in.ibm.com \
    --to=bharata@linux.vnet.ibm.com \
    --cc=afaerber@suse.de \
    --cc=agraf@suse.de \
    --cc=armbru@redhat.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=ehabkost@redhat.com \
    --cc=imammedo@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).