virsh: Create macro for common "config" option

Rather than continually cut-n-paste the strings into each command,
create a common macro to be used generically. The macro will take a
single argument _helpstr which for many options in virsh-domain.c
is simply "affect next boot". So, create a second macro within that
file in order to define the more common use as a revector to the
common macro with the common _helpstr.

Signed-off-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
John Ferlan
2016-01-09 08:36:26 -05:00
parent c7ccd8b2e6
commit 0dbac60b9e
4 changed files with 41 additions and 121 deletions

View File

@@ -290,10 +290,7 @@ static const vshCmdOptDef opts_dommemstat[] = {
.flags = VSH_OFLAG_REQ_OPT,
.help = N_("period in seconds to set collection")
},
{.name = "config",
.type = VSH_OT_BOOL,
.help = N_("affect next boot")
},
VIRSH_COMMON_OPT_CONFIG(N_("affect next boot")),
{.name = "live",
.type = VSH_OT_BOOL,
.help = N_("affect running domain")
@@ -681,10 +678,7 @@ static const vshCmdOptDef opts_domif_getlink[] = {
.type = VSH_OT_ALIAS,
.help = "config"
},
{.name = "config",
.type = VSH_OT_BOOL,
.help = N_("Get persistent interface state")
},
VIRSH_COMMON_OPT_CONFIG(N_("Get persistent interface state")),
{.name = NULL}
};