mirror of https://gitee.com/openkylin/libvirt.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 c67e04e25f
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 <nitkon12@linux.vnet.ibm.com>
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
parent
d1eea6c12a
commit
4ae0f65669
|
@ -1093,7 +1093,7 @@ virHostCPUGetMap(unsigned char **cpumap,
|
|||
if (online)
|
||||
*online = virBitmapCountBits(cpus);
|
||||
|
||||
ret = virBitmapSize(cpus);
|
||||
ret = virHostCPUGetCount();
|
||||
|
||||
cleanup:
|
||||
if (ret < 0 && cpumap)
|
||||
|
|
Loading…
Reference in New Issue