[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH] xl cpupool-numa-split: don't try to bring any dom0 vCPUs online



Since commit a9dd01431a799b6743193a75f4f1ce2fdfdb7296, main_cpupoolnumasplit
wants to ensure that dom0 doesn't have more online vCPUs than the number of
pCPUs in a NUMA node.

However, if dom0 already has fewer online vCPUs than the number of pCPUs in a
NUMA node, this will cause some to be made online.

Furthermore, if dom0's maximum number of vCPUs is less than the number of pCPUs,
this will result in an error like the following:

    libxl: error: libxl.c:5564:libxl_set_vcpuonline: Requested 24 VCPUs, 
however maxcpus is 12!: Function not implemented
    error on removing vcpus for Domain-0

Instead, make main_cpupoolnumasplit only reduce the number of vCPUs dom0 has
online, and don't try to add any more.

This incurs an extra call to libxl_domain_info to find out the current number of
dom0 vCPUs. Conveniently, there is already an initialised libxl_dominfo that we
can use.

Signed-off-by: Jonathan Davies <jonathan.davies@xxxxxxxxxx>
---
 tools/libxl/xl_cmdimpl.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 7f961e3..d5df20d 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -8614,12 +8614,19 @@ int main_cpupoolnumasplit(int argc, char **argv)
         goto out;
     }
 
+    if (libxl_domain_info(ctx, &info, 0)) {
+        fprintf(stderr, "error on getting info for Domain-0\n");
+        goto out;
+    }
+
     n = 0;
     for (c = 0; c < n_cpus; c++) {
         if (topology[c].node == node) {
             topology[c].node = LIBXL_CPUTOPOLOGY_INVALID_ENTRY;
-            libxl_bitmap_set(&cpumap, n);
-            n++;
+            if (n < info.vcpu_online) {
+                libxl_bitmap_set(&cpumap, n);
+                n++;
+            }
         }
     }
     if (libxl_domain_info(ctx, &info, 0)) {
-- 
1.9.1


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

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.