Stefano Stabellini
2011-Sep-07 15:50 UTC
[Xen-devel] [PATCH] libxl: vcpu_avail is a bitmask, use it as such
vcpu_avail is a bitmask of available cpus but we are currently using it
as the number of cpus available. This patch fixes it.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
diff -r 6580ff415189 tools/libxl/libxl_dm.c
--- a/tools/libxl/libxl_dm.c Wed Sep 07 13:29:15 2011 +0000
+++ b/tools/libxl/libxl_dm.c Wed Sep 07 15:39:46 2011 +0000
@@ -360,8 +360,13 @@ static char ** libxl__build_device_model
}
if (info->vcpus > 1) {
flexarray_append(dm_args, "-smp");
+ /* vcpu_avail is actually a bit mask, the new qemu doesn''t
+ * support a bitmask of available cpus but it supports a
+ * number of available cpus lower than the maximum number of
+ * cpus. Let''s do that for now. */
if (info->vcpu_avail)
- flexarray_append(dm_args, libxl__sprintf(gc,
"%d,maxcpus=%d", info->vcpus, info->vcpu_avail));
+ flexarray_append(dm_args, libxl__sprintf(gc,
"%d,maxcpus=%d",
+ __builtin_popcount(info->vcpu_avail),
info->vcpus));
else
flexarray_append(dm_args, libxl__sprintf(gc, "%d",
info->vcpus));
}
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
Seemingly Similar Threads
- [PATCH] libxl: use preferred syntax for network device creation with upstream qemu
- [PATCH QXL 2/2] libxl: Add qxl vga interface support.
- [PATCH] libxl: Set VNC password through QMP
- [PATCH v4] libxl: Spice vdagent support for upstream qemu
- [PATCH] Properly control platform device creation in upstream QEMU
