]> xenbits.xensource.com Git - libvirt.git/commitdiff
virsh: qemu-monitor-command: Use macro for exclusive options
authorPeter Krempa <pkrempa@redhat.com>
Mon, 1 Aug 2016 04:12:17 +0000 (06:12 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 2 Aug 2016 11:55:47 +0000 (13:55 +0200)
tools/virsh-domain.c

index dbdee5be0ca9a6579381c195c5dc4b028dc6b09b..6c1bc2f3097f433ed0849dc14eabc4e3b36dce22 100644 (file)
@@ -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;