提交 c7ccd8b2 编写于 作者: J John Ferlan

virsh: Create macro for common "persistent" option

Rather than continually cut-n-paste the strings into each command,
create a common macro to be used generically.  Note that not all
'{.name = "persistent",' entries are replaced, just those that have the
common .help string of "make live change persistent".

Non replaced instances are unique to the command.
Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
上级 b6fb1e24
......@@ -66,6 +66,12 @@
#define VIRSH_COMMON_OPT_DOMAIN_FULL \
VIRSH_COMMON_OPT_DOMAIN(N_("domain name, id or uuid")) \
#define VIRSH_COMMON_OPT_DOMAIN_PERSISTENT \
{.name = "persistent", \
.type = VSH_OT_BOOL, \
.help = N_("make live change persistent") \
} \
static virDomainPtr
virshLookupDomainInternal(vshControl *ctl,
const char *cmdname,
......@@ -214,10 +220,7 @@ static const vshCmdOptDef opts_attach_device[] = {
.flags = VSH_OFLAG_REQ,
.help = N_("XML file")
},
{.name = "persistent",
.type = VSH_OT_BOOL,
.help = N_("make live change persistent")
},
VIRSH_COMMON_OPT_DOMAIN_PERSISTENT,
{.name = "config",
.type = VSH_OT_BOOL,
.help = N_("affect next boot")
......@@ -377,10 +380,7 @@ static const vshCmdOptDef opts_attach_disk[] = {
.type = VSH_OT_BOOL,
.help = N_("print XML document rather than attach the disk")
},
{.name = "persistent",
.type = VSH_OT_BOOL,
.help = N_("make live change persistent")
},
VIRSH_COMMON_OPT_DOMAIN_PERSISTENT,
{.name = "config",
.type = VSH_OT_BOOL,
.help = N_("affect next boot")
......@@ -837,10 +837,7 @@ static const vshCmdOptDef opts_attach_interface[] = {
.type = VSH_OT_STRING,
.help = N_("control domain's outgoing traffics")
},
{.name = "persistent",
.type = VSH_OT_BOOL,
.help = N_("make live change persistent")
},
VIRSH_COMMON_OPT_DOMAIN_PERSISTENT,
{.name = "config",
.type = VSH_OT_BOOL,
.help = N_("affect next boot")
......@@ -10863,10 +10860,7 @@ static const vshCmdOptDef opts_detach_device[] = {
.flags = VSH_OFLAG_REQ,
.help = N_("XML file")
},
{.name = "persistent",
.type = VSH_OT_BOOL,
.help = N_("make live change persistent")
},
VIRSH_COMMON_OPT_DOMAIN_PERSISTENT,
{.name = "config",
.type = VSH_OT_BOOL,
.help = N_("affect next boot")
......@@ -10960,10 +10954,7 @@ static const vshCmdOptDef opts_update_device[] = {
.flags = VSH_OFLAG_REQ,
.help = N_("XML file")
},
{.name = "persistent",
.type = VSH_OT_BOOL,
.help = N_("make live change persistent")
},
VIRSH_COMMON_OPT_DOMAIN_PERSISTENT,
{.name = "config",
.type = VSH_OT_BOOL,
.help = N_("affect next boot")
......@@ -11062,10 +11053,7 @@ static const vshCmdOptDef opts_detach_interface[] = {
.type = VSH_OT_STRING,
.help = N_("MAC address")
},
{.name = "persistent",
.type = VSH_OT_BOOL,
.help = N_("make live change persistent")
},
VIRSH_COMMON_OPT_DOMAIN_PERSISTENT,
{.name = "config",
.type = VSH_OT_BOOL,
.help = N_("affect next boot")
......@@ -11474,10 +11462,7 @@ static const vshCmdOptDef opts_detach_disk[] = {
.flags = VSH_OFLAG_REQ,
.help = N_("target of disk device")
},
{.name = "persistent",
.type = VSH_OT_BOOL,
.help = N_("make live change persistent")
},
VIRSH_COMMON_OPT_DOMAIN_PERSISTENT,
{.name = "config",
.type = VSH_OT_BOOL,
.help = N_("affect next boot")
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册