From: Peter Krempa Date: Mon, 9 Sep 2019 08:55:20 +0000 (+0200) Subject: virsh: Don't open-code virJSONStringReformat in cmdQemuMonitorCommand X-Git-Tag: v5.8.0-rc1~141 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=73aaa8f8c84eae3201aeb06eed7b79e650e15f60;p=thirdparty%2Flibvirt.git virsh: Don't open-code virJSONStringReformat in cmdQemuMonitorCommand Signed-off-by: Peter Krempa Reviewed-by: Daniel Henrique Barboza Reviewed-by: Ján Tomko --- diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index 8c24935938..fbfdc09c0d 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -9512,7 +9512,6 @@ cmdQemuMonitorCommand(vshControl *ctl, const vshCmd *cmd) unsigned int flags = 0; const vshCmdOpt *opt = NULL; virBuffer buf = VIR_BUFFER_INITIALIZER; - VIR_AUTOPTR(virJSONValue) pretty = NULL; VSH_EXCLUSIVE_OPTIONS("hmp", "pretty"); @@ -9538,8 +9537,7 @@ cmdQemuMonitorCommand(vshControl *ctl, const vshCmd *cmd) if (vshCommandOptBool(cmd, "pretty")) { char *tmp; - pretty = virJSONValueFromString(result); - if (pretty && (tmp = virJSONValueToString(pretty, true))) { + if ((tmp = virJSONStringReformat(result, true))) { VIR_FREE(result); result = tmp; virTrimSpaces(result, NULL);