[libvirt] [PATCH] tools: fix output of list with state-shutoff

Martin Kletzander mkletzan at redhat.com
Tue Dec 1 06:51:27 UTC 2015


On Tue, Dec 01, 2015 at 12:37:47AM +0000, Wei, Jiangang wrote:
>On Mon, 2015-11-30 at 15:20 +0100, Martin Kletzander wrote:
>> On Mon, Nov 30, 2015 at 06:08:40PM +0800, Wei Jiangang wrote:
>> >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
>> >
>>
>> Unfortunately, the filters do not clearly align with what virsh allows
>> the user to choose.  This is probably the most clean way to make that
>> work, so ACK.  I will push it in a while.
>
>Sorry for the alignment problem.
>I will pay more attention for it next time.
>

Oh, that's not problem with your patch, that's a problem of the design,
the options that virsh provides are supposed to behave little bit
differently then what those flags do and that was the cause of the
problem.  The patch is perfectly fine ;)

>Thanks,
>Wei
>>
>> >
>> >
>> >--
>> >libvir-list mailing list
>> >libvir-list at redhat.com
>> >https://www.redhat.com/mailman/listinfo/libvir-list
>
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20151201/defb1e2f/attachment-0001.sig>


More information about the libvir-list mailing list