[libvirt] [PATCH] tools: fix output of list with state-shutoff
Wei Jiangang
weijg.fnst at cn.fujitsu.com
Mon Nov 30 10:08:40 UTC 2015
Due to the default of flags is VIR_CONNECT_LIST_DOMAINS_ACTIVE,
It doesn't show the domains that have been shutdown when we use
'virsh list' with only --state-shutoff.
Signed-off-by: Wei Jiangang <weijg.fnst at cn.fujitsu.com>
---
tools/virsh-domain-monitor.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tools/virsh-domain-monitor.c b/tools/virsh-domain-monitor.c
index d4e500b..7b30c4c 100644
--- a/tools/virsh-domain-monitor.c
+++ b/tools/virsh-domain-monitor.c
@@ -1873,7 +1873,8 @@ cmdList(vshControl *ctl, const vshCmd *cmd)
unsigned int flags = VIR_CONNECT_LIST_DOMAINS_ACTIVE;
/* construct filter flags */
- if (vshCommandOptBool(cmd, "inactive"))
+ if (vshCommandOptBool(cmd, "inactive") ||
+ vshCommandOptBool(cmd, "state-shutoff"))
flags = VIR_CONNECT_LIST_DOMAINS_INACTIVE;
if (vshCommandOptBool(cmd, "all"))
--
1.9.3
More information about the libvir-list
mailing list