[libvirt] [PATCH v2] Don't print extra newline in virsh domstats output
Nitesh Konkar
niteshkonkar.libvirt at gmail.com
Mon Feb 20 09:53:04 UTC 2017
Polite PIng.
On Fri, Feb 10, 2017 at 8:34 PM, Nitesh Konkar <
niteshkonkar.libvirt at gmail.com> wrote:
> Signed-off-by: Nitesh Konkar <nitkon12 at linux.vnet.ibm.com>
> ---
> 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20170220/a17e2932/attachment-0001.htm>
More information about the libvir-list
mailing list