Re: [PATCH v2] Don't print extra newline in virsh domstats output

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Polite PIng.

On Fri, Feb 10, 2017 at 8:34 PM, Nitesh Konkar <niteshkonkar.libvirt@xxxxxxxxx> wrote:
Signed-off-by: Nitesh Konkar <nitkon12@xxxxxxxxxxxxxxxxxx>
---
virsh domstats --perf
Domain: 'Fedora123'
  perf.cache_misses=394986

Domain: 'Fedora'
  perf.cache_misses=447017

virsh domstats
Domain: 'Fedora123'
  state.state=1
  state.reason=1
  cpu.time=562472167198
  cpu.user=228340000000
  cpu.system=303250000000
  balloon.current=1048576
  balloon.maximum=1048576
  perf.cache_misses=634012

Domain: 'Fedora'
  state.state=1
  state.reason=1
  cpu.time=19303277561180
  cpu.user=5634250000000
  cpu.system=9536140000000
  balloon.current=1048576
  balloon.maximum=1048576
  perf.cache_misses=699207

 tools/virsh-domain-monitor.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/tools/virsh-domain-monitor.c b/tools/virsh-domain-monitor.c
index 77aa272..901a6eb 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;
--
1.9.3


--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]
  Powered by Linux