Re: [PATCH 06/12] virsh: Create macros for VSH_OT_ARGV "domain" option

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, May 04, 2018 at 17:25:27 +0800, Lin Ma wrote:
> Signed-off-by: Lin Ma <lma@xxxxxxxx>
> ---
>  tools/virsh-domain-monitor.c | 3 +++
>  tools/virsh-domain.c         | 3 +++
>  tools/virsh-snapshot.c       | 3 +++
>  tools/virsh.h                | 9 +++++++++
>  4 files changed, 18 insertions(+)
> 
> diff --git a/tools/virsh-domain-monitor.c b/tools/virsh-domain-monitor.c
> index 8ad651626b..e4a21534cb 100644
> --- a/tools/virsh-domain-monitor.c
> +++ b/tools/virsh-domain-monitor.c
> @@ -46,6 +46,9 @@
>  #define VIRSH_COMMON_OPT_DOMAIN_OT_STRING_FULL(cflags) \
>      VIRSH_COMMON_OPT_DOMAIN_OT_STRING(N_("domain name, id or uuid"), cflags)
>  
> +#define VIRSH_COMMON_OPT_DOMAIN_OT_ARGV_FULL(cflags) \
> +    VIRSH_COMMON_OPT_DOMAIN_OT_ARGV(N_("domain name, id or uuid"), cflags)

All of these defined here are unused (even in the other patches in this
series), so what's the point of adding them?

> +
>  VIR_ENUM_DECL(virshDomainIOError)
>  VIR_ENUM_IMPL(virshDomainIOError,
>                VIR_DOMAIN_DISK_ERROR_LAST,
> diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
> index 689f9d686b..89aefbf86a 100644
> --- a/tools/virsh-domain.c
> +++ b/tools/virsh-domain.c
> @@ -71,6 +71,9 @@
>  #define VIRSH_COMMON_OPT_DOMAIN_OT_STRING_FULL(cflags) \
>      VIRSH_COMMON_OPT_DOMAIN_OT_STRING(N_("domain name, id or uuid"), cflags)
>  
> +#define VIRSH_COMMON_OPT_DOMAIN_OT_ARGV_FULL(cflags) \
> +    VIRSH_COMMON_OPT_DOMAIN_OT_ARGV(N_("domain name, id or uuid"), cflags)
> +
>  #define VIRSH_COMMON_OPT_DOMAIN_PERSISTENT \
>      {.name = "persistent", \
>       .type = VSH_OT_BOOL, \
> diff --git a/tools/virsh-snapshot.c b/tools/virsh-snapshot.c
> index 3d86ac84d1..0c86b6c950 100644
> --- a/tools/virsh-snapshot.c
> +++ b/tools/virsh-snapshot.c
> @@ -48,6 +48,9 @@
>  #define VIRSH_COMMON_OPT_DOMAIN_OT_STRING_FULL(cflags) \
>      VIRSH_COMMON_OPT_DOMAIN_OT_STRING(N_("domain name, id or uuid"), cflags)
>  
> +#define VIRSH_COMMON_OPT_DOMAIN_OT_ARGV_FULL(cflags) \
> +    VIRSH_COMMON_OPT_DOMAIN_OT_ARGV(N_("domain name, id or uuid"), cflags)
> +
>  /* Helper for snapshot-create and snapshot-create-as */

Also all of them have the same docs string so I really don't know why we
need to define them in every file separately ...

>  static bool
>  virshSnapshotCreate(vshControl *ctl, virDomainPtr dom, const char *buffer,
> diff --git a/tools/virsh.h b/tools/virsh.h
> index 9dcf104cc4..a33d108b2d 100644
> --- a/tools/virsh.h
> +++ b/tools/virsh.h
> @@ -115,6 +115,15 @@
>       .completer_flags = cflags, \
>      }
>  
> +# define VIRSH_COMMON_OPT_DOMAIN_OT_ARGV(_helpstr, cflags) \
> +    {.name = "domain", \
> +     .type = VSH_OT_ARGV, \
> +     .flags = VSH_OFLAG_NONE, \
> +     .help = _helpstr, \
> +     .completer = virshDomainNameCompleter, \
> +     .completer_flags = cflags, \
> +    }
> +
>  typedef struct _virshControl virshControl;
>  typedef virshControl *virshControlPtr;
>  
> -- 
> 2.15.1
> 
> --
> libvir-list mailing list
> libvir-list@xxxxxxxxxx
> https://www.redhat.com/mailman/listinfo/libvir-list

Attachment: signature.asc
Description: PGP signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux