From 9eb11dcf46ec420b0365d96fa5dd2f4a449cd4d7 Mon Sep 17 00:00:00 2001 From: Juergen Gross Date: Tue, 14 Jun 2016 06:30:58 +0200 Subject: [PATCH] xl: correct xl cpupool-numa-split with vcpu limited dom0 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 Signed-off-by: Juergen Gross Reviewed-by: Dario Faggioli Acked-by: Wei Liu (cherry picked from commit c256d2afc1cad0cca912492e338d6ff97e477c4f) (cherry picked from commit 78a30103813a7929e922de7414cc56fa2ae52984) (cherry picked from commit f8972b4223ee76800afa13432403daf248b46805) --- tools/libxl/xl_cmdimpl.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c index 173e773fbd..a78f22d432 100644 --- a/tools/libxl/xl_cmdimpl.c +++ b/tools/libxl/xl_cmdimpl.c @@ -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); -- 2.39.5