Re: [Xen-devel] [PATCH v6 08/12] libxl: Update xenstore on VCPU hotplug for all guest types

2017-01-04 Thread Wei Liu
On Tue, Jan 03, 2017 at 09:04:12AM -0500, Boris Ostrovsky wrote:
> Currently HVM guests that use upstream qemu do not update xenstore's
> availability entry for VCPUs. While it is not strictly necessary for
> hotplug to work, xenstore ends up not reflecting actual status of
> VCPUs. We should fix this.
> 
> Signed-off-by: Boris Ostrovsky 

Acked-by: Wei Liu 

> ---
>  tools/libxl/libxl.c | 6 --
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
> index 6fd4fe1..3de 100644
> --- a/tools/libxl/libxl.c
> +++ b/tools/libxl/libxl.c
> @@ -5148,7 +5148,6 @@ int libxl_set_vcpuonline(libxl_ctx *ctx, uint32_t 
> domid, libxl_bitmap *cpumap)
>  switch (libxl__device_model_version_running(gc, domid)) {
>  case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL:
>  case LIBXL_DEVICE_MODEL_VERSION_NONE:
> -rc = libxl__set_vcpuonline_xenstore(gc, domid, cpumap, );
>  break;
>  case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN:
>  rc = libxl__set_vcpuonline_qmp(gc, domid, cpumap, );
> @@ -5158,11 +5157,14 @@ int libxl_set_vcpuonline(libxl_ctx *ctx, uint32_t 
> domid, libxl_bitmap *cpumap)
>  }
>  break;
>  case LIBXL_DOMAIN_TYPE_PV:
> -rc = libxl__set_vcpuonline_xenstore(gc, domid, cpumap, );
>  break;
>  default:
>  rc = ERROR_INVAL;
>  }
> +
> +if (!rc)
> +rc = libxl__set_vcpuonline_xenstore(gc, domid, cpumap, );
> +
>  out:
>  libxl_dominfo_dispose();
>  GC_FREE;
> -- 
> 2.7.4
> 

___
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel


[Xen-devel] [PATCH v6 08/12] libxl: Update xenstore on VCPU hotplug for all guest types

2017-01-03 Thread Boris Ostrovsky
Currently HVM guests that use upstream qemu do not update xenstore's
availability entry for VCPUs. While it is not strictly necessary for
hotplug to work, xenstore ends up not reflecting actual status of
VCPUs. We should fix this.

Signed-off-by: Boris Ostrovsky 
---
 tools/libxl/libxl.c | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 6fd4fe1..3de 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -5148,7 +5148,6 @@ int libxl_set_vcpuonline(libxl_ctx *ctx, uint32_t domid, 
libxl_bitmap *cpumap)
 switch (libxl__device_model_version_running(gc, domid)) {
 case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL:
 case LIBXL_DEVICE_MODEL_VERSION_NONE:
-rc = libxl__set_vcpuonline_xenstore(gc, domid, cpumap, );
 break;
 case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN:
 rc = libxl__set_vcpuonline_qmp(gc, domid, cpumap, );
@@ -5158,11 +5157,14 @@ int libxl_set_vcpuonline(libxl_ctx *ctx, uint32_t 
domid, libxl_bitmap *cpumap)
 }
 break;
 case LIBXL_DOMAIN_TYPE_PV:
-rc = libxl__set_vcpuonline_xenstore(gc, domid, cpumap, );
 break;
 default:
 rc = ERROR_INVAL;
 }
+
+if (!rc)
+rc = libxl__set_vcpuonline_xenstore(gc, domid, cpumap, );
+
 out:
 libxl_dominfo_dispose();
 GC_FREE;
-- 
2.7.4


___
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel