
On Thu, Mar 26, 2015 at 08:50:24AM -0400, John Ferlan wrote:
On 03/25/2015 02:39 PM, Ján Tomko wrote:
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;
Considering the other discussion about Set/Add/Del IOThread and since you're modifying the code anyway...
How about adding a check for:
if (info[i].iothread_id == 0) continue;
That way we can "prepare" for a configuration that may have "holes" on the delete and won't have some future issue with a 1.2.14 virsh receiving something unexpected from a 1.2.15 daemon.
We would not need to include empty elements in the array - the holes would be apparent from the presence of a thread with id=1, then id=3. Otherwise the thread_id element would be redundant. Jan