From: Peter Krempa Date: Mon, 1 Aug 2016 04:12:17 +0000 (+0200) Subject: virsh: qemu-monitor-command: Use macro for exclusive options X-Git-Tag: v2.2.0-rc1~211 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=36428fa80ba393abe2619f4dbbbbdebd052be420;p=thirdparty%2Flibvirt.git virsh: qemu-monitor-command: Use macro for exclusive options --- diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index dbdee5be0c..6c1bc2f309 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -8945,6 +8945,8 @@ cmdQemuMonitorCommand(vshControl *ctl, const vshCmd *cmd) bool pad = false; virJSONValuePtr pretty = NULL; + VSH_EXCLUSIVE_OPTIONS("hmp", "pretty"); + dom = virshCommandOptDomain(ctl, cmd, NULL); if (dom == NULL) goto cleanup; @@ -8961,13 +8963,8 @@ cmdQemuMonitorCommand(vshControl *ctl, const vshCmd *cmd) } monitor_cmd = virBufferContentAndReset(&buf); - if (vshCommandOptBool(cmd, "hmp")) { - if (vshCommandOptBool(cmd, "pretty")) { - vshError(ctl, _("--hmp and --pretty are not compatible")); - goto cleanup; - } + if (vshCommandOptBool(cmd, "hmp")) flags |= VIR_DOMAIN_QEMU_MONITOR_COMMAND_HMP; - } if (virDomainQemuMonitorCommand(dom, monitor_cmd, &result, flags) < 0) goto cleanup;