From 8dbc95cbd18a5abab8f313b1ea9da7b3d7faaa32 Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Mon, 1 Aug 2016 06:13:39 +0200 Subject: [PATCH] virsh: qemu-monitor-command: Don't print extra newline with --pretty The prettified JSON string already contains a newline so don't print another one. This allows to pipe the json output (in conjunction with the --quiet option) to files without having to truncate them afterwards. --- tools/virsh-domain.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index 9c496b90dd..fc77f162f0 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -8972,6 +8972,7 @@ cmdQemuMonitorCommand(vshControl *ctl, const vshCmd *cmd) if (pretty && (tmp = virJSONValueToString(pretty, true))) { VIR_FREE(result); result = tmp; + virTrimSpaces(result, NULL); } else { vshResetLibvirtError(); }