From: Nitesh Konkar Date: Thu, 25 May 2017 10:17:43 +0000 (+0530) Subject: util: hostcpu: Correctly report total number of vcpus in virHostCPUGetMap X-Git-Tag: v3.4.0-rc2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4ae0f65669a6672a408e08698678ed2958a77fde;p=thirdparty%2Flibvirt.git util: hostcpu: Correctly report total number of vcpus in virHostCPUGetMap Callers expect the return value to be the total number of vcpus in the host (including offline vcpus). The refactor in c67e04e25fa58104e0fae41 broke this assumption by using virHostCPUGetOnlineBitmap which only creates a bitmap long enough to hold the last online vcpu. Report the full number of host vcpus by returning value from virHostCPUGetCount(). Signed-off-by: Nitesh Konkar Signed-off-by: Peter Krempa --- diff --git a/src/util/virhostcpu.c b/src/util/virhostcpu.c index aa9cfeac20..c485a97211 100644 --- a/src/util/virhostcpu.c +++ b/src/util/virhostcpu.c @@ -1093,7 +1093,7 @@ virHostCPUGetMap(unsigned char **cpumap, if (online) *online = virBitmapCountBits(cpus); - ret = virBitmapSize(cpus); + ret = virHostCPUGetCount(); cleanup: if (ret < 0 && cpumap)