]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Don't print extra newline in virsh domstats output
authorNitesh Konkar <niteshkonkar.libvirt@gmail.com>
Fri, 10 Feb 2017 15:04:42 +0000 (20:34 +0530)
committerJohn Ferlan <jferlan@redhat.com>
Mon, 6 Mar 2017 16:40:21 +0000 (11:40 -0500)
Signed-off-by: Nitesh Konkar <nitkon12@linux.vnet.ibm.com>
tools/virsh-domain-monitor.c

index 77aa272265a44db332f7c797cc63a890b6f8d7e3..901a6ebef6277e3d288e7c7b09ebe20917f43a9c 100644 (file)
@@ -2047,7 +2047,6 @@ virshDomainStatsPrintRecord(vshControl *ctl ATTRIBUTE_UNUSED,
         VIR_FREE(param);
     }
 
-    vshPrint(ctl, "\n");
     return true;
 }
 
@@ -2145,9 +2144,13 @@ cmdDomstats(vshControl *ctl, const vshCmd *cmd)
            goto cleanup;
     }
 
-    for (next = records; *next; next++) {
+    next = records;
+    while (*next) {
         if (!virshDomainStatsPrintRecord(ctl, *next, raw))
             goto cleanup;
+
+        if (*(++next))
+            vshPrint(ctl, "\n");
     }
 
     ret = true;