[libvirt] [PATCH] virsh: add check for exclusive options for domstats command

Pavel Hrdina phrdina at redhat.com
Tue Mar 31 13:34:10 UTC 2015


Option --domain cannot be combined with options --list-*.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1143837

Signed-off-by: Pavel Hrdina <phrdina at redhat.com>
---
 tools/virsh-domain-monitor.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/tools/virsh-domain-monitor.c b/tools/virsh-domain-monitor.c
index 6951db2..e683a6d 100644
--- a/tools/virsh-domain-monitor.c
+++ b/tools/virsh-domain-monitor.c
@@ -2110,6 +2110,15 @@ cmdDomstats(vshControl *ctl, const vshCmd *cmd)
     const vshCmdOpt *opt = NULL;
     bool ret = false;
 
+    VSH_EXCLUSIVE_OPTIONS("domain", "list-active");
+    VSH_EXCLUSIVE_OPTIONS("domain", "list-inactive");
+    VSH_EXCLUSIVE_OPTIONS("domain", "list-persistent");
+    VSH_EXCLUSIVE_OPTIONS("domain", "list-transient");
+    VSH_EXCLUSIVE_OPTIONS("domain", "list-running");
+    VSH_EXCLUSIVE_OPTIONS("domain", "list-paused");
+    VSH_EXCLUSIVE_OPTIONS("domain", "list-shutoff");
+    VSH_EXCLUSIVE_OPTIONS("domain", "list-other");
+
     if (vshCommandOptBool(cmd, "state"))
         stats |= VIR_DOMAIN_STATS_STATE;
 
-- 
2.0.5




More information about the libvir-list mailing list