]> xenbits.xensource.com Git - xen.git/commitdiff
tools/libxl: correct vcpu affinity output with sparse physical cpu map
authorJuergen Gross <jgross@suse.com>
Fri, 31 Aug 2018 15:22:04 +0000 (17:22 +0200)
committerIan Jackson <ian.jackson@eu.citrix.com>
Thu, 16 May 2019 16:04:35 +0000 (17:04 +0100)
With not all physical cpus online (e.g. with smt=0) the output of hte
vcpu affinities is wrong, as the affinity bitmaps are capped after
nr_cpus bits, instead of using max_cpu_id.

Signed-off-by: Juergen Gross <jgross@suse.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
(cherry picked from commit 2ec5339ec9218fbf1583fa85b74d1d2f15f1b3b8)
(cherry picked from commit b55ff4c879ac202c5d53ad1985f86cc0865edb2f)

tools/xl/xl_vcpu.c

index 3384eeed069ecc1821860f550190f3b3c1a4ddbe..c877f2595fca2168130a8739a17e6337754a7a3d 100644 (file)
@@ -144,13 +144,13 @@ static void vcpulist(int argc, char **argv)
         }
 
         for (i = 0; i<nb_domain; i++)
-            print_domain_vcpuinfo(dominfo[i].domid, physinfo.nr_cpus);
+            print_domain_vcpuinfo(dominfo[i].domid, physinfo.max_cpu_id + 1);
 
         libxl_dominfo_list_free(dominfo, nb_domain);
     } else {
         for (; argc > 0; ++argv, --argc) {
             uint32_t domid = find_domain(*argv);
-            print_domain_vcpuinfo(domid, physinfo.nr_cpus);
+            print_domain_vcpuinfo(domid, physinfo.max_cpu_id + 1);
         }
     }
   vcpulist_out: