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

Peter Krempa pkrempa at redhat.com
Tue Mar 31 13:40:44 UTC 2015


On Tue, Mar 31, 2015 at 15:34:10 +0200, Pavel Hrdina wrote:
> 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;

NACK, it was a deliberate design decision to allow users provide filters
along with domain lists with the intention that we might want to filter
the list provided by users.

It was never implemented though.

Peter
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20150331/b8868c83/attachment-0001.sig>


More information about the libvir-list mailing list