From: Ian Campbell Subject: Re: [PATCH] libxl: Use -vcpu_avail with qemu-xen. Date: Mon, 3 Jun 2013 09:37:28 +0100 Message-ID: <1370248648.404.5.camel@zakaz.uk.xensource.com> References: <1370017993-13437-1-git-send-email-anthony.perard@citrix.com> <1370018361-14556-1-git-send-email-anthony.perard@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1370018361-14556-1-git-send-email-anthony.perard@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Anthony PERARD Cc: Stefano Stabellini , Xen Devel List-Id: xen-devel@lists.xenproject.org On Fri, 2013-05-31 at 17:39 +0100, Anthony PERARD wrote: > This require the series CPU hotplug for qemu-xen. > > Note: this patch is valid only for 4.3 as the -vcpu_avail will > probably not be upstream to Qemu. Ugh. So how are we going to handle this in the future? libxl ideally needs to work with upstream qemu or our qemu seamlessly, which would mean needed to know whether to use -vcpu_avail vs. whatever upstream has. I'd much prefer to make our qemu export the same interface and use that... > > Signed-off-by: Anthony PERARD > --- > tools/libxl/libxl_dm.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c > index 1e3a9f4..2db2372 100644 > --- a/tools/libxl/libxl_dm.c > +++ b/tools/libxl/libxl_dm.c > @@ -530,11 +530,17 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc, > flexarray_append(dm_args, "-smp"); > if (b_info->avail_vcpus.size) { > int nr_set_cpus = 0; > + char *s; > nr_set_cpus = libxl_bitmap_count_set(&b_info->avail_vcpus); > > flexarray_append(dm_args, libxl__sprintf(gc, "%d,maxcpus=%d", > nr_set_cpus, > b_info->max_vcpus)); > + > + s = libxl_bitmap_to_hex_string(CTX, &b_info->avail_vcpus); > + flexarray_vappend(dm_args, "-vcpu_avail", > + libxl__sprintf(gc, "%s", s), NULL); > + free(s); > } else > flexarray_append(dm_args, libxl__sprintf(gc, "%d", > b_info->max_vcpus));