WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] libxl: vcpu_avail is a bitmask, use it as such

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] libxl: vcpu_avail is a bitmask, use it as such
From: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
Date: Wed, 7 Sep 2011 16:50:57 +0100
Delivery-date: Wed, 07 Sep 2011 08:43:38 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Alpine 2.00 (DEB 1167 2008-08-23)
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@xxxxxxxxxxxxx>

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@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] libxl: vcpu_avail is a bitmask, use it as such, Stefano Stabellini <=