[libvirt] [PATCH 17/18] virsh: Introduce virshDomainInterfaceCompleter

Martin Kletzander mkletzan at redhat.com
Thu Jan 11 10:51:10 UTC 2018


On Tue, Jan 02, 2018 at 06:12:10PM +0100, Michal Privoznik wrote:
>For given domain fetch list of defined interfaces. This can be
>used for commands like domif-getlink and others. If available,
>the interface name is returned (e.g. "vnet0", usually available
>only for running domains), if not the MAC address is returned.
>Moreover, the detach-interface command requires only MAC address
>and therefore we have new flag that forces the completer to
>return just the MAC address.
>
>Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
>---
> tools/virsh-completer.c      | 60 ++++++++++++++++++++++++++++++++++++++++++++
> tools/virsh-completer.h      |  8 ++++++
> tools/virsh-domain-monitor.c |  3 +++
> tools/virsh-domain.c         |  4 +++
> 4 files changed, 75 insertions(+)
>
>diff --git a/tools/virsh-completer.h b/tools/virsh-completer.h
>index 288e17909..680cd12ff 100644
>--- a/tools/virsh-completer.h
>+++ b/tools/virsh-completer.h
>@@ -30,4 +30,12 @@ char ** virshDomainNameCompleter(vshControl *ctl,
>                                  const vshCmd *cmd,
>                                  unsigned int flags);
>
>+enum {
>+    VIRSH_DOMAIN_INTERFACE_COMPLETER_MAC = 1 << 1, /* Return just MACs */

Why are you starting from 2? Why not start from 1?  Didn't you mean 1 << 0?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20180111/c8aa9941/attachment-0001.sig>


More information about the libvir-list mailing list