[libvirt] [PATCH 6/7] Do not use vshPrintPinInfo in iothreadinfo

Ján Tomko jtomko at redhat.com
Wed Mar 25 18:39:11 UTC 2015


Just format the bitmap via virBitmapFormat.
---
 tools/virsh-domain.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index afd92b1..cb9cb9d 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -6834,6 +6834,7 @@ cmdIOThreadInfo(vshControl *ctl, const vshCmd *cmd)
     size_t i;
     int maxcpu;
     unsigned int flags = VIR_DOMAIN_AFFECT_CURRENT;
+    virBitmapPtr map = NULL;
 
     VSH_EXCLUSIVE_OPTIONS_VAR(current, live);
     VSH_EXCLUSIVE_OPTIONS_VAR(current, config);
@@ -6863,16 +6864,24 @@ cmdIOThreadInfo(vshControl *ctl, const vshCmd *cmd)
                   _("IOThread ID"), _("CPU Affinity"));
     vshPrintExtra(ctl, "---------------------------------------------------\n");
     for (i = 0; i < niothreads; i++) {
+        char *mapstr = NULL;
+        virBitmapFree(map);
+        map = virBitmapNewData(info[i]->cpumap, info[i]->cpumaplen);
+        if (!map)
+            goto cleanup;
+
+        if (!(mapstr = virBitmapFormat(map)))
+            goto cleanup;
 
         vshPrint(ctl, " %-15u ", info[i]->iothread_id);
-        ignore_value(vshPrintPinInfo(info[i]->cpumap, info[i]->cpumaplen,
-                                     maxcpu, 0));
+        vshPrint(ctl, " %-15s ", mapstr);
         vshPrint(ctl, "\n");
         virDomainIOThreadInfoFree(info[i]);
     }
     VIR_FREE(info);
 
  cleanup:
+    virBitmapFree(map);
     virDomainFree(dom);
     return niothreads >= 0;
 }
-- 
2.0.5




More information about the libvir-list mailing list