From 7a696e9c3d1ca39c94633bca4166bb8478f66a62 Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Thu, 14 Mar 2024 22:09:06 +0100 Subject: [PATCH] virsh: Inline VIRSH_COMMON_OPT_DOMAIN_OT_STRING macro MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Upcoming patches will need to tweak some of the properties of the command. Since the macro is used in just two places expand it inline. Signed-off-by: Peter Krempa Reviewed-by: Ján Tomko --- tools/virsh-domain-event.c | 7 +++++-- tools/virsh-domain.c | 14 +++++++++++--- tools/virsh.h | 13 ------------- 3 files changed, 16 insertions(+), 18 deletions(-) diff --git a/tools/virsh-domain-event.c b/tools/virsh-domain-event.c index 2ff7f7b81c..73b00f3bb2 100644 --- a/tools/virsh-domain-event.c +++ b/tools/virsh-domain-event.c @@ -865,8 +865,11 @@ static const vshCmdInfo info_event = { }; static const vshCmdOptDef opts_event[] = { - VIRSH_COMMON_OPT_DOMAIN_OT_STRING(N_("filter by domain name, id or uuid"), - 0, 0), + {.name = "domain", + .type = VSH_OT_STRING, + .help = N_("filter by domain name, id or uuid"), + .completer = virshDomainNameCompleter, + }, {.name = "event", .type = VSH_OT_STRING, .completer = virshDomainEventNameCompleter, diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index cd37828660..0bf4d524b0 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -9826,8 +9826,11 @@ static const vshCmdInfo info_qemu_monitor_event = { }; static const vshCmdOptDef opts_qemu_monitor_event[] = { - VIRSH_COMMON_OPT_DOMAIN_OT_STRING(N_("filter by domain name, id or uuid"), - 0, 0), + {.name = "domain", + .type = VSH_OT_STRING, + .help = N_("filter by domain name, id or uuid"), + .completer = virshDomainNameCompleter, + }, {.name = "event", .type = VSH_OT_STRING, .help = N_("filter by event name") @@ -10322,7 +10325,12 @@ static const vshCmdOptDef opts_domxmltonative[] = { .required = true, .help = N_("target config data type format") }, - VIRSH_COMMON_OPT_DOMAIN_OT_STRING_FULL(VSH_OFLAG_REQ_OPT, 0), + {.name = "domain", + .type = VSH_OT_STRING, + .flags = VSH_OFLAG_REQ_OPT, + .help = N_("domain name, id or uuid"), + .completer = virshDomainNameCompleter, + }, {.name = "xml", .type = VSH_OT_STRING, .completer = virshCompletePathLocalExisting, diff --git a/tools/virsh.h b/tools/virsh.h index 1114c1572b..ff0cf80911 100644 --- a/tools/virsh.h +++ b/tools/virsh.h @@ -109,19 +109,6 @@ .help = _helpstr \ } -#define VIRSH_COMMON_OPT_DOMAIN_OT_STRING(_helpstr, oflags, cflags) \ - {.name = "domain", \ - .type = VSH_OT_STRING, \ - .flags = oflags, \ - .help = _helpstr, \ - .completer = virshDomainNameCompleter, \ - .completer_flags = cflags, \ - } - -#define VIRSH_COMMON_OPT_DOMAIN_OT_STRING_FULL(oflags, cflags) \ - VIRSH_COMMON_OPT_DOMAIN_OT_STRING(N_("domain name, id or uuid"), \ - oflags, cflags) - typedef struct _virshControl virshControl; typedef struct _virshCtrlData virshCtrlData;