From: Nitesh Konkar Date: Fri, 10 Feb 2017 15:04:42 +0000 (+0530) Subject: Don't print extra newline in virsh domstats output X-Git-Tag: v3.2.0-rc1~352 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=78d2bb74867f77089d1ce8bef2ba641f4b7d69b6;p=thirdparty%2Flibvirt.git Don't print extra newline in virsh domstats output Signed-off-by: Nitesh Konkar --- diff --git a/tools/virsh-domain-monitor.c b/tools/virsh-domain-monitor.c index 77aa272265..901a6ebef6 100644 --- a/tools/virsh-domain-monitor.c +++ b/tools/virsh-domain-monitor.c @@ -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;