]> xenbits.xensource.com Git - xen.git/commitdiff
xl: correct xl cpupool-numa-split with vcpu limited dom0
authorJuergen Gross <jgross@suse.com>
Tue, 14 Jun 2016 04:30:58 +0000 (06:30 +0200)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Mon, 15 Aug 2016 10:50:46 +0000 (11:50 +0100)
When trying to use xl cpupool-numa-split and dom0 is limited to less
vcpus than one numa node the operation will fail.

Correct this by allowing this configuration.

Reported-by: Glenn Enright <glenn@rimuhosting.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Dario Faggioli <dario.faggioli@citrix.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
(cherry picked from commit c256d2afc1cad0cca912492e338d6ff97e477c4f)
(cherry picked from commit 78a30103813a7929e922de7414cc56fa2ae52984)
(cherry picked from commit f8972b4223ee76800afa13432403daf248b46805)

tools/libxl/xl_cmdimpl.c

index 173e773fbd092298543450fd3a6c3417ee509a11..a78f22d4326fcc39c6c5cb0347f486e7fbede2ee 100644 (file)
@@ -7542,7 +7542,11 @@ int main_cpupoolnumasplit(int argc, char **argv)
             n++;
         }
     }
-    if (libxl_set_vcpuonline(ctx, 0, &cpumap)) {
+    if (libxl_domain_info(ctx, &info, 0)) {
+        fprintf(stderr, "error on getting info for Domain-0\n");
+        goto out;
+    }
+    if (info.vcpu_online > n && libxl_set_vcpuonline(ctx, 0, &cpumap)) {
         fprintf(stderr, "error on removing vcpus for Domain-0\n");
         goto out;
     }
@@ -7551,7 +7555,7 @@ int main_cpupoolnumasplit(int argc, char **argv)
             fprintf(stderr, "error on getting info for Domain-0\n");
             goto out;
         }
-        if (info.vcpu_online == n) {
+        if (info.vcpu_online <= n) {
             break;
         }
         sleep(1);