xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Anthony PERARD <anthony.perard@citrix.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@citrix.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Xen Devel <xen-devel@lists.xen.org>
Subject: Re: [PATCH v2 2/2] libxl: Use QMP cpu-add to hotplug CPU with qemu-xen.
Date: Mon, 17 Jun 2013 16:50:43 +0100	[thread overview]
Message-ID: <51BF3053.5010701@citrix.com> (raw)
In-Reply-To: <1371483062.8055.15.camel@dagon.hellion.org.uk>

On 17/06/13 16:31, Ian Campbell wrote:
> On Mon, 2013-06-17 at 15:20 +0100, Anthony PERARD wrote:
>> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
> 
> I'm not sure but I think we might want to do both the xenstore and the
> qmp thing on qemu-xen for the benefit of PVHVM guests. I've added Konrad
> to the CC.

ok, that should be not to complicated to do, if necessary.

>> ---
>>  tools/libxl/libxl.c | 41 ++++++++++++++++++++++++++++++++++++++++-
>>  1 file changed, 40 insertions(+), 1 deletion(-)
>>
>> diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
>> index ee1fa9c..e31b866 100644
>> --- a/tools/libxl/libxl.c
>> +++ b/tools/libxl/libxl.c
>> @@ -4237,7 +4237,8 @@ int libxl_domain_get_nodeaffinity(libxl_ctx *ctx, uint32_t domid,
>>      return 0;
>>  }
>>  
>> -int libxl_set_vcpuonline(libxl_ctx *ctx, uint32_t domid, libxl_bitmap *cpumap)
>> +static int libxl__set_vcpuonline_xenstore(libxl_ctx *ctx, uint32_t domid,
>> +                                         libxl_bitmap *cpumap)
> 
> It's a bit tedious but really you ought to make this take a gc not a ctx
> when you internalise it. You can start the function with "libxl__ctx*ctx
> = libxl__gc_owner(gc)", or s/ctx/CTX/ in the body.

OK, will change this.

>>  {
>>      GC_INIT(ctx);
>>      libxl_dominfo info;
>> @@ -4268,6 +4269,44 @@ out:
>>      return rc;
>>  }
>>  
>> +static int libxl__set_vcpuonline_qmp(libxl__gc *gc, uint32_t domid,
>> +                                     libxl_bitmap *cpumap)
>> +{
>> +    libxl_dominfo info;
>> +    int i, rc = 0;
>> +
>> +    if (libxl_domain_info(CTX, &info, domid) < 0) {
>> +        LIBXL__LOG_ERRNO(CTX, LIBXL__LOG_ERROR, "getting domain info list");
> 
> The LOG() macros is useful here.

will change this.

>> +        rc = ERROR_FAIL;
>> +        goto out;
>> +    }
>> +    for (i = 0; i <= info.vcpu_max_id; i++) {
>> +        if (libxl_bitmap_test(cpumap, i)) {
>> +            rc = libxl__qmp_cpu_add(gc, domid, i);
>> +        }
>> +    }
>> +out:
>> +    return rc;
>> +}
> 
> 


-- 
Anthony PERARD

  reply	other threads:[~2013-06-17 15:50 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-17 14:13 [PATCH v2 0/7] CPU hotplug for qemu-xen for 4.3 Anthony PERARD
2013-06-17 14:15 ` [PATCH 1/7] cpu: Introduce get_arch_id() method and override it for X86CPU Anthony PERARD
2013-06-17 14:15   ` [PATCH 2/7] cpu: Add qemu_for_each_cpu() Anthony PERARD
2013-06-17 14:15   ` [PATCH 3/7] acpi_piix4: Add infrastructure to send CPU hot-plug GPE to guest Anthony PERARD
2013-06-17 14:15   ` [PATCH 4/7] Add hot_add_cpu hook to QEMUMachine Anthony PERARD
2013-06-17 14:15   ` [PATCH 5/7] QMP: Add cpu-add command Anthony PERARD
2013-06-17 14:15   ` [PATCH 6/7] xen: Fix vcpus initialisation Anthony PERARD
2013-06-20 11:14     ` Stefano Stabellini
2013-06-17 14:15   ` [PATCH 7/7] xen: Implement hot_add_cpu hook Anthony PERARD
2013-06-20 11:21     ` Stefano Stabellini
2013-06-20 13:19       ` Anthony PERARD
2013-06-20 13:40     ` Stefano Stabellini
2013-06-21 17:40       ` Anthony PERARD
2013-06-17 14:20 ` [PATCH v2 1/2] libxl: Add "cpu-add" QMP command Anthony PERARD
2013-06-17 14:20   ` [PATCH v2 2/2] libxl: Use QMP cpu-add to hotplug CPU with qemu-xen Anthony PERARD
2013-06-17 15:31     ` Ian Campbell
2013-06-17 15:50       ` Anthony PERARD [this message]
2013-06-20 11:12         ` Stefano Stabellini
2013-06-17 15:25   ` [PATCH v2 1/2] libxl: Add "cpu-add" QMP command Ian Campbell
2013-06-17 15:28     ` Anthony PERARD
2013-06-17 15:31       ` Ian Campbell
2013-06-17 14:22 ` [PATCH v2] xen: Allow CPU to be counted than currently "plugged" Anthony PERARD
2013-06-17 15:24   ` Ian Campbell
2013-06-17 15:44     ` Anthony PERARD
2013-06-24 16:57 ` [PATCH v2 0/7] CPU hotplug for qemu-xen for 4.3 Stefano Stabellini
2013-06-24 17:21   ` Stefano Stabellini
2013-06-24 17:28     ` Anthony PERARD
2013-06-25  9:19   ` George Dunlap
2013-06-25 11:40     ` Stefano Stabellini

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=51BF3053.5010701@citrix.com \
    --to=anthony.perard@citrix.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=konrad.wilk@oracle.com \
    --cc=stefano.stabellini@citrix.com \
    --cc=xen-devel@lists.xen.org \
    /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).