[libvirt] [PATCH] virsh: host: Use bitmap size in bytes rather than bit count

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1329819 --- tools/virsh-host.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/virsh-host.c b/tools/virsh-host.c index 80ac4bd..c9b2646 100644 --- a/tools/virsh-host.c +++ b/tools/virsh-host.c @@ -699,7 +699,7 @@ cmdNodeCpuMap(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED) vshPrint(ctl, "%-15s ", _("CPU map:")); if (pretty) { - char *str = virBitmapDataToString(cpumap, cpunum); + char *str = virBitmapDataToString(cpumap, VIR_DIV_UP(cpunum, 8)); if (!str) goto cleanup; -- 2.8.1

On Mon, Apr 25, 2016 at 10:43:41AM +0200, Peter Krempa wrote:
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1329819 --- tools/virsh-host.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/virsh-host.c b/tools/virsh-host.c index 80ac4bd..c9b2646 100644 --- a/tools/virsh-host.c +++ b/tools/virsh-host.c @@ -699,7 +699,7 @@ cmdNodeCpuMap(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED)
vshPrint(ctl, "%-15s ", _("CPU map:")); if (pretty) { - char *str = virBitmapDataToString(cpumap, cpunum); + char *str = virBitmapDataToString(cpumap, VIR_DIV_UP(cpunum, 8));
Using VIR_CPU_MAPLEN(cpunum) would be more obvious and consistent. ACK with that change. Jan

On Mon, Apr 25, 2016 at 10:43:41AM +0200, Peter Krempa wrote:
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1329819 --- tools/virsh-host.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
ACK
participants (3)
-
Ján Tomko
-
Pavel Hrdina
-
Peter Krempa