1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2024-12-23 21:34:54 +03:00

virsh: Create macro for "file" option

Rather than continually cut/paste the "file" option for pool command
option structures, generate a macro which will commonly define it for
any command.  Then of course use that macro.
This commit is contained in:
John Ferlan 2015-11-25 09:08:54 -05:00
parent cf793b0042
commit e178688f8e

View File

@ -40,6 +40,13 @@
.help = N_("pool name or uuid") \
} \
#define VSH_POOL_FILE_OPT_COMMON \
{.name = "file", \
.type = VSH_OT_DATA, \
.flags = VSH_OFLAG_REQ, \
.help = N_("file containing an XML pool description") \
} \
virStoragePoolPtr
virshCommandOptPoolBy(vshControl *ctl, const vshCmd *cmd, const char *optname,
const char **name, unsigned int flags)
@ -145,11 +152,8 @@ static const vshCmdInfo info_pool_create[] = {
};
static const vshCmdOptDef opts_pool_create[] = {
{.name = "file",
.type = VSH_OT_DATA,
.flags = VSH_OFLAG_REQ,
.help = N_("file containing an XML pool description")
},
VSH_POOL_FILE_OPT_COMMON,
{.name = NULL}
};
@ -410,11 +414,8 @@ static const vshCmdInfo info_pool_define[] = {
};
static const vshCmdOptDef opts_pool_define[] = {
{.name = "file",
.type = VSH_OT_DATA,
.flags = VSH_OFLAG_REQ,
.help = N_("file containing an XML pool description")
},
VSH_POOL_FILE_OPT_COMMON,
{.name = NULL}
};