From: Ian Campbell Subject: Re: [PATCH] libxl: Fix vcpu-set for PV guest. Date: Tue, 4 Feb 2014 14:46:50 +0000 Message-ID: <1391525210.6497.9.camel@kazak.uk.xensource.com> References: <1391186147-15191-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: <1391186147-15191-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: George Dunlap , Yun Wang , Xen Devel List-Id: xen-devel@lists.xenproject.org On Fri, 2014-01-31 at 16:35 +0000, Anthony PERARD wrote: > vcpu-set will try to use the HVM path (through QEMU) instead of the PV > path (through xenstore) for a PV guest, if there is a QEMU running for > this domain. This patch check which kind of guest is running before > before doing any call. > > Signed-off-by: Anthony PERARD Acked-by: Ian Campbell > --- > > Yun, is this patch fix the issue with your PV guest ? Yun, any feedback on this patch? George -- I think vcpu-set not working for PV guests is a bug worth fixing in 4.4 so I intend to apply. > > > tools/libxl/libxl.c | 19 ++++++++++++++----- > 1 file changed, 14 insertions(+), 5 deletions(-) > > diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c > index 2845ca4..c4fe6af 100644 > --- a/tools/libxl/libxl.c > +++ b/tools/libxl/libxl.c > @@ -4692,12 +4692,21 @@ int libxl_set_vcpuonline(libxl_ctx *ctx, uint32_t domid, libxl_bitmap *cpumap) > { > GC_INIT(ctx); > int rc; > - switch (libxl__device_model_version_running(gc, domid)) { > - case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL: > - rc = libxl__set_vcpuonline_xenstore(gc, domid, cpumap); > + switch (libxl__domain_type(gc, domid)) { > + case LIBXL_DOMAIN_TYPE_HVM: > + switch (libxl__device_model_version_running(gc, domid)) { > + case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL: > + rc = libxl__set_vcpuonline_xenstore(gc, domid, cpumap); > + break; > + case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN: > + rc = libxl__set_vcpuonline_qmp(gc, domid, cpumap); > + break; > + default: > + rc = ERROR_INVAL; > + } > break; > - case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN: > - rc = libxl__set_vcpuonline_qmp(gc, domid, cpumap); > + case LIBXL_DOMAIN_TYPE_PV: > + rc = libxl__set_vcpuonline_xenstore(gc, domid, cpumap); > break; > default: > rc = ERROR_INVAL;