]> xenbits.xensource.com Git - libvirt.git/commitdiff
virsh: vcpupin: Ask for pinning info for all vCPUs
authorPeter Krempa <pkrempa@redhat.com>
Wed, 17 Feb 2016 14:53:42 +0000 (15:53 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Wed, 9 Mar 2016 09:09:16 +0000 (10:09 +0100)
The API docs state that the API queries pinning info for all vCPUs and
thus we should allocate the bitmap even for the inactive ones.

The API will currently return bitmap only for the active vCPUs but that
will change in the future.

tools/virsh-domain.c

index f66faca14fc6a0753a302fc49d4e6d66d2cba353..41c749dffb88fe77533440ca9d0d2c61111c8430 100644 (file)
@@ -6381,12 +6381,13 @@ virshVcpuPinQuery(vshControl *ctl,
                   unsigned int flags)
 {
     unsigned char *cpumap = NULL;
+    unsigned int countFlags = flags | VIR_DOMAIN_VCPU_MAXIMUM;
     int cpumaplen;
     size_t i;
     int ncpus;
     bool ret = false;
 
-    if ((ncpus = virshCPUCountCollect(ctl, dom, flags, true)) < 0) {
+    if ((ncpus = virshCPUCountCollect(ctl, dom, countFlags, true)) < 0) {
         if (ncpus == -1) {
             if (flags & VIR_DOMAIN_AFFECT_LIVE)
                 vshError(ctl, "%s", _("cannot get vcpupin for offline domain"));