From: Peter Krempa Date: Wed, 17 Feb 2016 14:53:42 +0000 (+0100) Subject: virsh: vcpupin: Ask for pinning info for all vCPUs X-Git-Tag: v1.3.3-rc1~256 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e7e6980dd83e233fb46fa310dcebbbaa0fde7bfd;p=thirdparty%2Flibvirt.git virsh: vcpupin: Ask for pinning info for all vCPUs 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. --- diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index f66faca14f..41c749dffb 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -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"));