diff options
author | Juergen Gross <juergen.gross@ts.fujitsu.com> | 2011-02-17 19:39:13 +0000 |
---|---|---|
committer | Juergen Gross <juergen.gross@ts.fujitsu.com> | 2011-02-17 19:39:13 +0000 |
commit | a9dd01431a799b6743193a75f4f1ce2fdfdb7296 (patch) | |
tree | faaf5b775a939d9df36d46db831bbce54edba3c7 /tools/libxl | |
parent | 8f4208be5d25c6ed5773aa1bb23256764b941a17 (diff) | |
download | xen-a9dd01431a799b6743193a75f4f1ce2fdfdb7296.tar.gz xen-a9dd01431a799b6743193a75f4f1ce2fdfdb7296.tar.bz2 xen-a9dd01431a799b6743193a75f4f1ce2fdfdb7296.zip |
xl cpupool-numa-split: reduce number of Dom0 vcpus
When reducing the number of physical cpus available for Domain-0 by xl
cpupool-numa-split, reduce the number of vcpus accordingly.
Signed-off-by: juergen.gross@ts.fujitsu.com
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Diffstat (limited to 'tools/libxl')
-rw-r--r-- | tools/libxl/xl_cmdimpl.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c index 32306de1c0..c1ff5a2e88 100644 --- a/tools/libxl/xl_cmdimpl.c +++ b/tools/libxl/xl_cmdimpl.c @@ -5785,6 +5785,7 @@ int main_cpupoolnumasplit(int argc, char **argv) libxl_cpumap cpumap; libxl_cpupoolinfo *poolinfo; libxl_topologyinfo topology; + libxl_dominfo info; while ((opt = getopt(argc, argv, "h")) != -1) { switch (opt) { @@ -5840,11 +5841,33 @@ int main_cpupoolnumasplit(int argc, char **argv) goto out; } + n = 0; for (c = 0; c < topology.nodemap.entries; c++) { if (topology.nodemap.array[c] == node) { topology.nodemap.array[c] = LIBXL_CPUARRAY_INVALID_ENTRY; + libxl_cpumap_set(&cpumap, n); + n++; + } + } + if (libxl_set_vcpuonline(&ctx, 0, &cpumap)) { + fprintf(stderr, "error on removing vcpus for Domain-0\n"); + goto out; + } + for (c = 0; c < 10; c++) { + if (libxl_domain_info(&ctx, &info, 0)) { + fprintf(stderr, "error on getting info for Domain-0\n"); + goto out; + } + if (info.vcpu_online == n) { + break; } + sleep(1); + } + if (info.vcpu_online > n) { + fprintf(stderr, "failed to offline vcpus\n"); + goto out; } + memset(cpumap.map, 0, cpumap.size); for (c = 0; c < topology.nodemap.entries; c++) { if (topology.nodemap.array[c] == LIBXL_CPUARRAY_INVALID_ENTRY) { |