|
|
3e5111 |
From 0a811ab61fdd075efa148e50f567c6a198b57148 Mon Sep 17 00:00:00 2001
|
|
|
3e5111 |
Message-Id: <0a811ab61fdd075efa148e50f567c6a198b57148@dist-git>
|
|
|
3e5111 |
From: Nitesh Konkar <niteshkonkar.libvirt@gmail.com>
|
|
|
3e5111 |
Date: Tue, 30 May 2017 13:48:17 +0200
|
|
|
3e5111 |
Subject: [PATCH] util: hostcpu: Correctly report total number of vcpus in
|
|
|
3e5111 |
virHostCPUGetMap
|
|
|
3e5111 |
|
|
|
3e5111 |
Callers expect the return value to be the total number of vcpus in the
|
|
|
3e5111 |
host (including offline vcpus). The refactor in c67e04e25fa58104e0fae41
|
|
|
3e5111 |
broke this assumption by using virHostCPUGetOnlineBitmap which only
|
|
|
3e5111 |
creates a bitmap long enough to hold the last online vcpu.
|
|
|
3e5111 |
|
|
|
3e5111 |
Report the full number of host vcpus by returning value from
|
|
|
3e5111 |
virHostCPUGetCount().
|
|
|
3e5111 |
|
|
|
3e5111 |
Signed-off-by: Nitesh Konkar <nitkon12@linux.vnet.ibm.com>
|
|
|
3e5111 |
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
|
|
|
3e5111 |
(cherry picked from commit 4ae0f65669a6672a408e08698678ed2958a77fde)
|
|
|
3e5111 |
|
|
|
3e5111 |
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1456793
|
|
|
3e5111 |
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
|
|
|
3e5111 |
---
|
|
|
3e5111 |
src/util/virhostcpu.c | 2 +-
|
|
|
3e5111 |
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
3e5111 |
|
|
|
3e5111 |
diff --git a/src/util/virhostcpu.c b/src/util/virhostcpu.c
|
|
|
3e5111 |
index 20d3a004b..67daace89 100644
|
|
|
3e5111 |
--- a/src/util/virhostcpu.c
|
|
|
3e5111 |
+++ b/src/util/virhostcpu.c
|
|
|
3e5111 |
@@ -1081,7 +1081,7 @@ virHostCPUGetMap(unsigned char **cpumap,
|
|
|
3e5111 |
if (online)
|
|
|
3e5111 |
*online = virBitmapCountBits(cpus);
|
|
|
3e5111 |
|
|
|
3e5111 |
- ret = virBitmapSize(cpus);
|
|
|
3e5111 |
+ ret = virHostCPUGetCount();
|
|
|
3e5111 |
|
|
|
3e5111 |
cleanup:
|
|
|
3e5111 |
if (ret < 0 && cpumap)
|
|
|
3e5111 |
--
|
|
|
3e5111 |
2.13.0
|
|
|
3e5111 |
|