virsh: Inline VIRSH_COMMON_OPT_DOMAIN_OT_STRING macro

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 <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Peter Krempa 2024-03-14 22:09:06 +01:00
parent 25be987715
commit 7a696e9c3d
3 changed files with 16 additions and 18 deletions

View File

@ -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,

View File

@ -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,

View File

@ -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;