[PATCH 1/3] virsh: qemu-monitor-command: Use macro for exclusive options

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---
 tools/virsh-domain.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index dbdee5b..6c1bc2f 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;
-- 
2.9.2

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]