提交 8e4108f0 编写于 作者: J John Ferlan

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: NJohn Ferlan <jferlan@redhat.com>
上级 0dbac60b
...@@ -291,10 +291,7 @@ static const vshCmdOptDef opts_dommemstat[] = { ...@@ -291,10 +291,7 @@ static const vshCmdOptDef opts_dommemstat[] = {
.help = N_("period in seconds to set collection") .help = N_("period in seconds to set collection")
}, },
VIRSH_COMMON_OPT_CONFIG(N_("affect next boot")), VIRSH_COMMON_OPT_CONFIG(N_("affect next boot")),
{.name = "live", VIRSH_COMMON_OPT_LIVE(N_("affect running domain")),
.type = VSH_OT_BOOL,
.help = N_("affect running domain")
},
{.name = "current", {.name = "current",
.type = VSH_OT_BOOL, .type = VSH_OT_BOOL,
.help = N_("affect current domain") .help = N_("affect current domain")
......
...@@ -75,6 +75,9 @@ ...@@ -75,6 +75,9 @@
#define VIRSH_COMMON_OPT_DOMAIN_CONFIG \ #define VIRSH_COMMON_OPT_DOMAIN_CONFIG \
VIRSH_COMMON_OPT_CONFIG(N_("affect next boot")) \ VIRSH_COMMON_OPT_CONFIG(N_("affect next boot")) \
#define VIRSH_COMMON_OPT_DOMAIN_LIVE \
VIRSH_COMMON_OPT_LIVE(N_("affect running domain")) \
static virDomainPtr static virDomainPtr
virshLookupDomainInternal(vshControl *ctl, virshLookupDomainInternal(vshControl *ctl,
const char *cmdname, const char *cmdname,
...@@ -225,10 +228,7 @@ static const vshCmdOptDef opts_attach_device[] = { ...@@ -225,10 +228,7 @@ static const vshCmdOptDef opts_attach_device[] = {
}, },
VIRSH_COMMON_OPT_DOMAIN_PERSISTENT, VIRSH_COMMON_OPT_DOMAIN_PERSISTENT,
VIRSH_COMMON_OPT_DOMAIN_CONFIG, VIRSH_COMMON_OPT_DOMAIN_CONFIG,
{.name = "live", VIRSH_COMMON_OPT_DOMAIN_LIVE,
.type = VSH_OT_BOOL,
.help = N_("affect running domain")
},
{.name = "current", {.name = "current",
.type = VSH_OT_BOOL, .type = VSH_OT_BOOL,
.help = N_("affect current domain") .help = N_("affect current domain")
...@@ -382,10 +382,7 @@ static const vshCmdOptDef opts_attach_disk[] = { ...@@ -382,10 +382,7 @@ static const vshCmdOptDef opts_attach_disk[] = {
}, },
VIRSH_COMMON_OPT_DOMAIN_PERSISTENT, VIRSH_COMMON_OPT_DOMAIN_PERSISTENT,
VIRSH_COMMON_OPT_DOMAIN_CONFIG, VIRSH_COMMON_OPT_DOMAIN_CONFIG,
{.name = "live", VIRSH_COMMON_OPT_DOMAIN_LIVE,
.type = VSH_OT_BOOL,
.help = N_("affect running domain")
},
{.name = "current", {.name = "current",
.type = VSH_OT_BOOL, .type = VSH_OT_BOOL,
.help = N_("affect current domain") .help = N_("affect current domain")
...@@ -836,10 +833,7 @@ static const vshCmdOptDef opts_attach_interface[] = { ...@@ -836,10 +833,7 @@ static const vshCmdOptDef opts_attach_interface[] = {
}, },
VIRSH_COMMON_OPT_DOMAIN_PERSISTENT, VIRSH_COMMON_OPT_DOMAIN_PERSISTENT,
VIRSH_COMMON_OPT_DOMAIN_CONFIG, VIRSH_COMMON_OPT_DOMAIN_CONFIG,
{.name = "live", VIRSH_COMMON_OPT_DOMAIN_LIVE,
.type = VSH_OT_BOOL,
.help = N_("affect running domain")
},
{.name = "current", {.name = "current",
.type = VSH_OT_BOOL, .type = VSH_OT_BOOL,
.help = N_("affect current domain") .help = N_("affect current domain")
...@@ -1279,10 +1273,7 @@ static const vshCmdOptDef opts_blkdeviotune[] = { ...@@ -1279,10 +1273,7 @@ static const vshCmdOptDef opts_blkdeviotune[] = {
.help = N_("I/O size in bytes") .help = N_("I/O size in bytes")
}, },
VIRSH_COMMON_OPT_DOMAIN_CONFIG, VIRSH_COMMON_OPT_DOMAIN_CONFIG,
{.name = "live", VIRSH_COMMON_OPT_DOMAIN_LIVE,
.type = VSH_OT_BOOL,
.help = N_("affect running domain")
},
{.name = "current", {.name = "current",
.type = VSH_OT_BOOL, .type = VSH_OT_BOOL,
.help = N_("affect current domain") .help = N_("affect current domain")
...@@ -1530,10 +1521,7 @@ static const vshCmdOptDef opts_blkiotune[] = { ...@@ -1530,10 +1521,7 @@ static const vshCmdOptDef opts_blkiotune[] = {
.help = N_("per-device bytes wrote per second, in the form of /path/to/device,write_bytes_sec,...") .help = N_("per-device bytes wrote per second, in the form of /path/to/device,write_bytes_sec,...")
}, },
VIRSH_COMMON_OPT_DOMAIN_CONFIG, VIRSH_COMMON_OPT_DOMAIN_CONFIG,
{.name = "live", VIRSH_COMMON_OPT_DOMAIN_LIVE,
.type = VSH_OT_BOOL,
.help = N_("affect running domain")
},
{.name = "current", {.name = "current",
.type = VSH_OT_BOOL, .type = VSH_OT_BOOL,
.help = N_("affect current domain") .help = N_("affect current domain")
...@@ -3216,10 +3204,7 @@ static const vshCmdOptDef opts_domiftune[] = { ...@@ -3216,10 +3204,7 @@ static const vshCmdOptDef opts_domiftune[] = {
.help = N_("control domain's outgoing traffics") .help = N_("control domain's outgoing traffics")
}, },
VIRSH_COMMON_OPT_DOMAIN_CONFIG, VIRSH_COMMON_OPT_DOMAIN_CONFIG,
{.name = "live", VIRSH_COMMON_OPT_DOMAIN_LIVE,
.type = VSH_OT_BOOL,
.help = N_("affect running domain")
},
{.name = "current", {.name = "current",
.type = VSH_OT_BOOL, .type = VSH_OT_BOOL,
.help = N_("affect current domain") .help = N_("affect current domain")
...@@ -4819,10 +4804,7 @@ static const vshCmdOptDef opts_schedinfo[] = { ...@@ -4819,10 +4804,7 @@ static const vshCmdOptDef opts_schedinfo[] = {
.help = N_("get/set current scheduler info") .help = N_("get/set current scheduler info")
}, },
VIRSH_COMMON_OPT_CONFIG(N_("get/set value to be used on next boot")), VIRSH_COMMON_OPT_CONFIG(N_("get/set value to be used on next boot")),
{.name = "live", VIRSH_COMMON_OPT_LIVE(N_("get/set value from running domain")),
.type = VSH_OT_BOOL,
.help = N_("get/set value from running domain")
},
{.name = "set", {.name = "set",
.type = VSH_OT_ARGV, .type = VSH_OT_ARGV,
.flags = VSH_OFLAG_NONE, .flags = VSH_OFLAG_NONE,
...@@ -5130,10 +5112,7 @@ static const vshCmdOptDef opts_dump[] = { ...@@ -5130,10 +5112,7 @@ static const vshCmdOptDef opts_dump[] = {
.flags = VSH_OFLAG_REQ, .flags = VSH_OFLAG_REQ,
.help = N_("where to dump the core") .help = N_("where to dump the core")
}, },
{.name = "live", VIRSH_COMMON_OPT_LIVE(N_("perform a live core dump if supported")),
.type = VSH_OT_BOOL,
.help = N_("perform a live core dump if supported")
},
{.name = "crash", {.name = "crash",
.type = VSH_OT_BOOL, .type = VSH_OT_BOOL,
.help = N_("crash the domain after core dump") .help = N_("crash the domain after core dump")
...@@ -6094,10 +6073,7 @@ static const vshCmdOptDef opts_vcpucount[] = { ...@@ -6094,10 +6073,7 @@ static const vshCmdOptDef opts_vcpucount[] = {
.type = VSH_OT_BOOL, .type = VSH_OT_BOOL,
.help = N_("get number of currently active vcpus") .help = N_("get number of currently active vcpus")
}, },
{.name = "live", VIRSH_COMMON_OPT_LIVE(N_("get value from running domain")),
.type = VSH_OT_BOOL,
.help = N_("get value from running domain")
},
VIRSH_COMMON_OPT_CONFIG(N_("get value to be used on next boot")), VIRSH_COMMON_OPT_CONFIG(N_("get value to be used on next boot")),
{.name = "current", {.name = "current",
.type = VSH_OT_BOOL, .type = VSH_OT_BOOL,
...@@ -6415,10 +6391,7 @@ static const vshCmdOptDef opts_vcpupin[] = { ...@@ -6415,10 +6391,7 @@ static const vshCmdOptDef opts_vcpupin[] = {
.help = N_("host cpu number(s) to set, or omit option to query") .help = N_("host cpu number(s) to set, or omit option to query")
}, },
VIRSH_COMMON_OPT_DOMAIN_CONFIG, VIRSH_COMMON_OPT_DOMAIN_CONFIG,
{.name = "live", VIRSH_COMMON_OPT_DOMAIN_LIVE,
.type = VSH_OT_BOOL,
.help = N_("affect running domain")
},
{.name = "current", {.name = "current",
.type = VSH_OT_BOOL, .type = VSH_OT_BOOL,
.help = N_("affect current domain") .help = N_("affect current domain")
...@@ -6616,10 +6589,7 @@ static const vshCmdOptDef opts_emulatorpin[] = { ...@@ -6616,10 +6589,7 @@ static const vshCmdOptDef opts_emulatorpin[] = {
.help = N_("host cpu number(s) to set, or omit option to query") .help = N_("host cpu number(s) to set, or omit option to query")
}, },
VIRSH_COMMON_OPT_DOMAIN_CONFIG, VIRSH_COMMON_OPT_DOMAIN_CONFIG,
{.name = "live", VIRSH_COMMON_OPT_DOMAIN_LIVE,
.type = VSH_OT_BOOL,
.help = N_("affect running domain")
},
{.name = "current", {.name = "current",
.type = VSH_OT_BOOL, .type = VSH_OT_BOOL,
.help = N_("affect current domain") .help = N_("affect current domain")
...@@ -6730,10 +6700,7 @@ static const vshCmdOptDef opts_setvcpus[] = { ...@@ -6730,10 +6700,7 @@ static const vshCmdOptDef opts_setvcpus[] = {
.help = N_("set maximum limit on next boot") .help = N_("set maximum limit on next boot")
}, },
VIRSH_COMMON_OPT_DOMAIN_CONFIG, VIRSH_COMMON_OPT_DOMAIN_CONFIG,
{.name = "live", VIRSH_COMMON_OPT_DOMAIN_LIVE,
.type = VSH_OT_BOOL,
.help = N_("affect running domain")
},
{.name = "current", {.name = "current",
.type = VSH_OT_BOOL, .type = VSH_OT_BOOL,
.help = N_("affect current domain") .help = N_("affect current domain")
...@@ -6815,10 +6782,7 @@ static const vshCmdInfo info_iothreadinfo[] = { ...@@ -6815,10 +6782,7 @@ static const vshCmdInfo info_iothreadinfo[] = {
static const vshCmdOptDef opts_iothreadinfo[] = { static const vshCmdOptDef opts_iothreadinfo[] = {
VIRSH_COMMON_OPT_DOMAIN_FULL, VIRSH_COMMON_OPT_DOMAIN_FULL,
VIRSH_COMMON_OPT_DOMAIN_CONFIG, VIRSH_COMMON_OPT_DOMAIN_CONFIG,
{.name = "live", VIRSH_COMMON_OPT_DOMAIN_LIVE,
.type = VSH_OT_BOOL,
.help = N_("affect running domain")
},
{.name = "current", {.name = "current",
.type = VSH_OT_BOOL, .type = VSH_OT_BOOL,
.help = N_("affect current domain") .help = N_("affect current domain")
...@@ -6907,10 +6871,7 @@ static const vshCmdOptDef opts_iothreadpin[] = { ...@@ -6907,10 +6871,7 @@ static const vshCmdOptDef opts_iothreadpin[] = {
.help = N_("host cpu number(s) to set") .help = N_("host cpu number(s) to set")
}, },
VIRSH_COMMON_OPT_DOMAIN_CONFIG, VIRSH_COMMON_OPT_DOMAIN_CONFIG,
{.name = "live", VIRSH_COMMON_OPT_DOMAIN_LIVE,
.type = VSH_OT_BOOL,
.help = N_("affect running domain")
},
{.name = "current", {.name = "current",
.type = VSH_OT_BOOL, .type = VSH_OT_BOOL,
.help = N_("affect current domain") .help = N_("affect current domain")
...@@ -6990,10 +6951,7 @@ static const vshCmdOptDef opts_iothreadadd[] = { ...@@ -6990,10 +6951,7 @@ static const vshCmdOptDef opts_iothreadadd[] = {
.help = N_("iothread for the new IOThread") .help = N_("iothread for the new IOThread")
}, },
VIRSH_COMMON_OPT_DOMAIN_CONFIG, VIRSH_COMMON_OPT_DOMAIN_CONFIG,
{.name = "live", VIRSH_COMMON_OPT_DOMAIN_LIVE,
.type = VSH_OT_BOOL,
.help = N_("affect running domain")
},
{.name = "current", {.name = "current",
.type = VSH_OT_BOOL, .type = VSH_OT_BOOL,
.help = N_("affect current domain") .help = N_("affect current domain")
...@@ -7061,10 +7019,7 @@ static const vshCmdOptDef opts_iothreaddel[] = { ...@@ -7061,10 +7019,7 @@ static const vshCmdOptDef opts_iothreaddel[] = {
.help = N_("iothread_id for the IOThread to delete") .help = N_("iothread_id for the IOThread to delete")
}, },
VIRSH_COMMON_OPT_DOMAIN_CONFIG, VIRSH_COMMON_OPT_DOMAIN_CONFIG,
{.name = "live", VIRSH_COMMON_OPT_DOMAIN_LIVE,
.type = VSH_OT_BOOL,
.help = N_("affect running domain")
},
{.name = "current", {.name = "current",
.type = VSH_OT_BOOL, .type = VSH_OT_BOOL,
.help = N_("affect current domain") .help = N_("affect current domain")
...@@ -7745,10 +7700,7 @@ static const vshCmdInfo info_desc[] = { ...@@ -7745,10 +7700,7 @@ static const vshCmdInfo info_desc[] = {
static const vshCmdOptDef opts_desc[] = { static const vshCmdOptDef opts_desc[] = {
VIRSH_COMMON_OPT_DOMAIN_FULL, VIRSH_COMMON_OPT_DOMAIN_FULL,
{.name = "live", VIRSH_COMMON_OPT_LIVE(N_("modify/get running state")),
.type = VSH_OT_BOOL,
.help = N_("modify/get running state")
},
VIRSH_COMMON_OPT_CONFIG(N_("modify/get persistent configuration")), VIRSH_COMMON_OPT_CONFIG(N_("modify/get persistent configuration")),
{.name = "current", {.name = "current",
.type = VSH_OT_BOOL, .type = VSH_OT_BOOL,
...@@ -7922,10 +7874,7 @@ static const vshCmdOptDef opts_metadata[] = { ...@@ -7922,10 +7874,7 @@ static const vshCmdOptDef opts_metadata[] = {
.flags = VSH_OFLAG_REQ, .flags = VSH_OFLAG_REQ,
.help = N_("URI of the namespace") .help = N_("URI of the namespace")
}, },
{.name = "live", VIRSH_COMMON_OPT_LIVE(N_("modify/get running state")),
.type = VSH_OT_BOOL,
.help = N_("modify/get running state")
},
VIRSH_COMMON_OPT_CONFIG(N_("modify/get persistent configuration")), VIRSH_COMMON_OPT_CONFIG(N_("modify/get persistent configuration")),
{.name = "current", {.name = "current",
.type = VSH_OT_BOOL, .type = VSH_OT_BOOL,
...@@ -8314,10 +8263,7 @@ static const vshCmdOptDef opts_setmem[] = { ...@@ -8314,10 +8263,7 @@ static const vshCmdOptDef opts_setmem[] = {
.help = N_("new memory size, as scaled integer (default KiB)") .help = N_("new memory size, as scaled integer (default KiB)")
}, },
VIRSH_COMMON_OPT_DOMAIN_CONFIG, VIRSH_COMMON_OPT_DOMAIN_CONFIG,
{.name = "live", VIRSH_COMMON_OPT_DOMAIN_LIVE,
.type = VSH_OT_BOOL,
.help = N_("affect running domain")
},
{.name = "current", {.name = "current",
.type = VSH_OT_BOOL, .type = VSH_OT_BOOL,
.help = N_("affect current domain") .help = N_("affect current domain")
...@@ -8401,10 +8347,7 @@ static const vshCmdOptDef opts_setmaxmem[] = { ...@@ -8401,10 +8347,7 @@ static const vshCmdOptDef opts_setmaxmem[] = {
.help = N_("new maximum memory size, as scaled integer (default KiB)") .help = N_("new maximum memory size, as scaled integer (default KiB)")
}, },
VIRSH_COMMON_OPT_DOMAIN_CONFIG, VIRSH_COMMON_OPT_DOMAIN_CONFIG,
{.name = "live", VIRSH_COMMON_OPT_DOMAIN_LIVE,
.type = VSH_OT_BOOL,
.help = N_("affect running domain")
},
{.name = "current", {.name = "current",
.type = VSH_OT_BOOL, .type = VSH_OT_BOOL,
.help = N_("affect current domain") .help = N_("affect current domain")
...@@ -8502,10 +8445,7 @@ static const vshCmdOptDef opts_memtune[] = { ...@@ -8502,10 +8445,7 @@ static const vshCmdOptDef opts_memtune[] = {
.help = N_("Min guaranteed memory, as scaled integer (default KiB)") .help = N_("Min guaranteed memory, as scaled integer (default KiB)")
}, },
VIRSH_COMMON_OPT_DOMAIN_CONFIG, VIRSH_COMMON_OPT_DOMAIN_CONFIG,
{.name = "live", VIRSH_COMMON_OPT_DOMAIN_LIVE,
.type = VSH_OT_BOOL,
.help = N_("affect running domain")
},
{.name = "current", {.name = "current",
.type = VSH_OT_BOOL, .type = VSH_OT_BOOL,
.help = N_("affect current domain") .help = N_("affect current domain")
...@@ -8678,10 +8618,7 @@ static const vshCmdOptDef opts_numatune[] = { ...@@ -8678,10 +8618,7 @@ static const vshCmdOptDef opts_numatune[] = {
.help = N_("NUMA node selections to set") .help = N_("NUMA node selections to set")
}, },
VIRSH_COMMON_OPT_DOMAIN_CONFIG, VIRSH_COMMON_OPT_DOMAIN_CONFIG,
{.name = "live", VIRSH_COMMON_OPT_DOMAIN_LIVE,
.type = VSH_OT_BOOL,
.help = N_("affect running domain")
},
{.name = "current", {.name = "current",
.type = VSH_OT_BOOL, .type = VSH_OT_BOOL,
.help = N_("affect current domain") .help = N_("affect current domain")
...@@ -9721,10 +9658,7 @@ static const vshCmdOptDef opts_migrate[] = { ...@@ -9721,10 +9658,7 @@ static const vshCmdOptDef opts_migrate[] = {
.flags = VSH_OFLAG_REQ, .flags = VSH_OFLAG_REQ,
.help = N_("connection URI of the destination host as seen from the client(normal migration) or source(p2p migration)") .help = N_("connection URI of the destination host as seen from the client(normal migration) or source(p2p migration)")
}, },
{.name = "live", VIRSH_COMMON_OPT_LIVE(N_("live migration")),
.type = VSH_OT_BOOL,
.help = N_("live migration")
},
{.name = "offline", {.name = "offline",
.type = VSH_OT_BOOL, .type = VSH_OT_BOOL,
.help = N_("offline migration") .help = N_("offline migration")
...@@ -10799,10 +10733,7 @@ static const vshCmdOptDef opts_detach_device[] = { ...@@ -10799,10 +10733,7 @@ static const vshCmdOptDef opts_detach_device[] = {
}, },
VIRSH_COMMON_OPT_DOMAIN_PERSISTENT, VIRSH_COMMON_OPT_DOMAIN_PERSISTENT,
VIRSH_COMMON_OPT_DOMAIN_CONFIG, VIRSH_COMMON_OPT_DOMAIN_CONFIG,
{.name = "live", VIRSH_COMMON_OPT_DOMAIN_LIVE,
.type = VSH_OT_BOOL,
.help = N_("affect running domain")
},
{.name = "current", {.name = "current",
.type = VSH_OT_BOOL, .type = VSH_OT_BOOL,
.help = N_("affect current domain") .help = N_("affect current domain")
...@@ -10890,10 +10821,7 @@ static const vshCmdOptDef opts_update_device[] = { ...@@ -10890,10 +10821,7 @@ static const vshCmdOptDef opts_update_device[] = {
}, },
VIRSH_COMMON_OPT_DOMAIN_PERSISTENT, VIRSH_COMMON_OPT_DOMAIN_PERSISTENT,
VIRSH_COMMON_OPT_DOMAIN_CONFIG, VIRSH_COMMON_OPT_DOMAIN_CONFIG,
{.name = "live", VIRSH_COMMON_OPT_DOMAIN_LIVE,
.type = VSH_OT_BOOL,
.help = N_("affect running domain")
},
{.name = "current", {.name = "current",
.type = VSH_OT_BOOL, .type = VSH_OT_BOOL,
.help = N_("affect current domain") .help = N_("affect current domain")
...@@ -10986,10 +10914,7 @@ static const vshCmdOptDef opts_detach_interface[] = { ...@@ -10986,10 +10914,7 @@ static const vshCmdOptDef opts_detach_interface[] = {
}, },
VIRSH_COMMON_OPT_DOMAIN_PERSISTENT, VIRSH_COMMON_OPT_DOMAIN_PERSISTENT,
VIRSH_COMMON_OPT_DOMAIN_CONFIG, VIRSH_COMMON_OPT_DOMAIN_CONFIG,
{.name = "live", VIRSH_COMMON_OPT_DOMAIN_LIVE,
.type = VSH_OT_BOOL,
.help = N_("affect running domain")
},
{.name = "current", {.name = "current",
.type = VSH_OT_BOOL, .type = VSH_OT_BOOL,
.help = N_("affect current domain") .help = N_("affect current domain")
...@@ -11392,10 +11317,7 @@ static const vshCmdOptDef opts_detach_disk[] = { ...@@ -11392,10 +11317,7 @@ static const vshCmdOptDef opts_detach_disk[] = {
}, },
VIRSH_COMMON_OPT_DOMAIN_PERSISTENT, VIRSH_COMMON_OPT_DOMAIN_PERSISTENT,
VIRSH_COMMON_OPT_DOMAIN_CONFIG, VIRSH_COMMON_OPT_DOMAIN_CONFIG,
{.name = "live", VIRSH_COMMON_OPT_DOMAIN_LIVE,
.type = VSH_OT_BOOL,
.help = N_("affect running domain")
},
{.name = "current", {.name = "current",
.type = VSH_OT_BOOL, .type = VSH_OT_BOOL,
.help = N_("affect current domain") .help = N_("affect current domain")
...@@ -12366,10 +12288,7 @@ static const vshCmdOptDef opts_change_media[] = { ...@@ -12366,10 +12288,7 @@ static const vshCmdOptDef opts_change_media[] = {
.help = N_("can be either or both of --live and --config, " .help = N_("can be either or both of --live and --config, "
"depends on implementation of hypervisor driver") "depends on implementation of hypervisor driver")
}, },
{.name = "live", VIRSH_COMMON_OPT_LIVE(N_("alter live configuration of running domain")),
.type = VSH_OT_BOOL,
.help = N_("alter live configuration of running domain")
},
VIRSH_COMMON_OPT_CONFIG(N_("alter persistent configuration, effect " VIRSH_COMMON_OPT_CONFIG(N_("alter persistent configuration, effect "
"observed on next boot")), "observed on next boot")),
{.name = "force", {.name = "force",
......
...@@ -907,10 +907,7 @@ static const vshCmdOptDef opts_network_update[] = { ...@@ -907,10 +907,7 @@ static const vshCmdOptDef opts_network_update[] = {
.help = N_("which parent object to search through") .help = N_("which parent object to search through")
}, },
VIRSH_COMMON_OPT_CONFIG(N_("affect next network startup")), VIRSH_COMMON_OPT_CONFIG(N_("affect next network startup")),
{.name = "live", VIRSH_COMMON_OPT_LIVE(N_("affect running network")),
.type = VSH_OT_BOOL,
.help = N_("affect running network")
},
{.name = "current", {.name = "current",
.type = VSH_OT_BOOL, .type = VSH_OT_BOOL,
.help = N_("affect current state of network") .help = N_("affect current state of network")
......
...@@ -163,10 +163,7 @@ static const vshCmdOptDef opts_snapshot_create[] = { ...@@ -163,10 +163,7 @@ static const vshCmdOptDef opts_snapshot_create[] = {
.type = VSH_OT_BOOL, .type = VSH_OT_BOOL,
.help = N_("require atomic operation") .help = N_("require atomic operation")
}, },
{.name = "live", VIRSH_COMMON_OPT_LIVE(N_("take a live snapshot")),
.type = VSH_OT_BOOL,
.help = N_("take a live snapshot")
},
{.name = NULL} {.name = NULL}
}; };
...@@ -364,10 +361,7 @@ static const vshCmdOptDef opts_snapshot_create_as[] = { ...@@ -364,10 +361,7 @@ static const vshCmdOptDef opts_snapshot_create_as[] = {
.type = VSH_OT_BOOL, .type = VSH_OT_BOOL,
.help = N_("require atomic operation") .help = N_("require atomic operation")
}, },
{.name = "live", VIRSH_COMMON_OPT_LIVE(N_("take a live snapshot")),
.type = VSH_OT_BOOL,
.help = N_("take a live snapshot")
},
{.name = "memspec", {.name = "memspec",
.type = VSH_OT_STRING, .type = VSH_OT_STRING,
.flags = VSH_OFLAG_REQ_OPT, .flags = VSH_OFLAG_REQ_OPT,
......
...@@ -82,6 +82,12 @@ ...@@ -82,6 +82,12 @@
.help = _helpstr \ .help = _helpstr \
} \ } \
# define VIRSH_COMMON_OPT_LIVE(_helpstr) \
{.name = "live", \
.type = VSH_OT_BOOL, \
.help = _helpstr \
} \
typedef struct _virshControl virshControl; typedef struct _virshControl virshControl;
typedef virshControl *virshControlPtr; typedef virshControl *virshControlPtr;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册