[libvirt] [PATCH v2 01/12] virsh: Move the definition of macro VIRSH_COMMON_OPT_DOMAIN_FULL to virsh.h
Michal Privoznik
mprivozn at redhat.com
Thu May 10 09:17:08 UTC 2018
On 05/08/2018 04:20 PM, Lin Ma wrote:
> centralize the definition of macro VIRSH_COMMON_OPT_DOMAIN_FULL to virsh.h
> to avoid unnecessary duplicated definition
>
> Signed-off-by: Lin Ma <lma at suse.com>
> ---
> tools/virsh-domain-monitor.c | 3 ---
> tools/virsh-domain.c | 3 ---
> tools/virsh-snapshot.c | 3 ---
> tools/virsh.h | 3 +++
> 4 files changed, 3 insertions(+), 9 deletions(-)
>
> diff --git a/tools/virsh-domain-monitor.c b/tools/virsh-domain-monitor.c
> index 8e071779b4..071619d0e3 100644
> --- a/tools/virsh-domain-monitor.c
> +++ b/tools/virsh-domain-monitor.c
> @@ -40,9 +40,6 @@
> #include "virxml.h"
> #include "virstring.h"
>
> -#define VIRSH_COMMON_OPT_DOMAIN_FULL(cflags) \
> - VIRSH_COMMON_OPT_DOMAIN(N_("domain name, id or uuid"), cflags)
> -
> 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 598d2fa4a4..aa11a81638 100644
> --- a/tools/virsh-domain.c
> +++ b/tools/virsh-domain.c
> @@ -65,9 +65,6 @@
> # define SA_SIGINFO 0
> #endif
>
> -#define VIRSH_COMMON_OPT_DOMAIN_FULL(cflags) \
> - VIRSH_COMMON_OPT_DOMAIN(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 e4908eea70..812fa91333 100644
> --- a/tools/virsh-snapshot.c
> +++ b/tools/virsh-snapshot.c
> @@ -42,9 +42,6 @@
> #include "virxml.h"
> #include "conf/snapshot_conf.h"
>
> -#define VIRSH_COMMON_OPT_DOMAIN_FULL(cflags) \
> - VIRSH_COMMON_OPT_DOMAIN(N_("domain name, id or uuid"), cflags)
> -
> /* Helper for snapshot-create and snapshot-create-as */
> static bool
> virshSnapshotCreate(vshControl *ctl, virDomainPtr dom, const char *buffer,
> diff --git a/tools/virsh.h b/tools/virsh.h
> index f2213ebb57..9e717ef574 100644
> --- a/tools/virsh.h
> +++ b/tools/virsh.h
> @@ -82,6 +82,9 @@
> .completer_flags = cflags, \
> }
>
> +#define VIRSH_COMMON_OPT_DOMAIN_FULL(cflags) \
> + VIRSH_COMMON_OPT_DOMAIN(N_("domain name, id or uuid"), cflags)
This needs to be:
# define VIRSH_...
because it's nested #define. syntax-check would catch this.
ACK with that fixed.
Michal
More information about the libvir-list
mailing list