<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, May 24, 2017 at 8:09 PM, Ján Tomko <span dir="ltr"><<a href="mailto:jtomko@redhat.com" target="_blank">jtomko@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail-">On Wed, May 24, 2017 at 07:46:00PM +0530, Nitesh Konkar wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Recent changes to virbitmap.c file created a regression<br>
where on executing the virsh nodecpumap command, the number<br>
of CPUs present was shown as (last cpu online id + 1). This<br>
patch fixes the issue.<br>
<br>
Signed-off-by: Nitesh Konkar <<a href="mailto:nitkon12@linux.vnet.ibm.com" target="_blank">nitkon12@linux.vnet.ibm.com</a>><br>
---<br>
src/Makefile.am      |  2 ++<br>
src/util/virbitmap.c | 10 ++++++++--<br>
2 files changed, 10 insertions(+), 2 deletions(-)<br>
<br>
</blockquote>
<br>
</span><span class="gmail-"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
diff --git a/src/util/virbitmap.c b/src/util/virbitmap.c<br>
index eac63d997..dc427f430 100644<br>
--- a/src/util/virbitmap.c<br>
+++ b/src/util/virbitmap.c<br>
@@ -37,6 +37,7 @@<br>
#include "count-one-bits.h"<br>
#include "virstring.h"<br>
#include "virerror.h"<br>
+#include "virhostcpu.h"<br>
<br>
#define VIR_FROM_THIS VIR_FROM_NONE<br>
<br>
@@ -565,9 +566,14 @@ virBitmapParseUnlimited(const char *str)<br>
    const char *cur = str;<br>
    char *tmp;<br>
    size_t i;<br>
-    int start, last;<br>
+    int start, last, bitmapSize;<br>
+<br>
+    bitmapSize = virHostCPUGetCount();<br>
</blockquote>
<br></span>
NACK.<br>
<br>
This function should be able to parse any bitmap, regardless of how many<br>
CPUs the host has.<br>
<br>
Jan<br></blockquote><div>Hi Jan,<br><br>However, currently we get the following output, which is invalid.<br><br><pre class="gmail-bz_comment_text" id="gmail-comment_text_0"># virsh nodecpumap
CPUs present:   73             <--- should be 80. 
CPUs online:    10
CPU map:        y-------y-------y-------y-------y-------y-------y-------y-------y-------y</pre><pre class="gmail-bz_comment_text" id="gmail-comment_text_0"># lscpu
Architecture:          ppc64le
Byte Order:            Little Endian
CPU(s):                80
On-line CPU(s) list:   0,8,16,24,32,40,48,56,64,72
Off-line CPU(s) list:  1-7,9-15,17-23,25-31,33-39,41-47,49-55,57-63,65-71,73-79
Thread(s) per core:    1
Core(s) per socket:    5
Socket(s):             2
NUMA node(s):          2
Model:                 2.1 (pvr 004b 0201)
Model name:            POWER8E (raw), altivec supported
L1d cache:             64K
L1i cache:             32K
L2 cache:              512K
L3 cache:              8192K
NUMA node0 CPU(s):     0,8,16,24,32
NUMA node1 CPU(s):     40,48,56,64,72<br><br># ls /sys/devices/system/cpu | grep cpu[0-9] | wc -l
80<br></pre></div></div>Thanks,<br></div><div class="gmail_extra">Nitesh.<br></div></div>