virsh: Create macro for common "live" 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 running domain". 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:27 -05:00
parent 0dbac60b9e
commit 8e4108f039
5 changed files with 41 additions and 128 deletions

View File

@@ -291,10 +291,7 @@ static const vshCmdOptDef opts_dommemstat[] = {
.help = N_("period in seconds to set collection")
},
VIRSH_COMMON_OPT_CONFIG(N_("affect next boot")),
{.name = "live",
.type = VSH_OT_BOOL,
.help = N_("affect running domain")
},
VIRSH_COMMON_OPT_LIVE(N_("affect running domain")),
{.name = "current",
.type = VSH_OT_BOOL,
.help = N_("affect current domain")