[libvirt] [PATCH 00/12] virsh: Partially convert to c99 struct initialization

For now, we have to suffice with vshCmdOptDef. Others coming soon. Changes are pretty mechanical, so if you find a mistake there, blame my vim macro :) Michal Privoznik (12): virsh.c: Switch to C99 initialization of vshCmdOptDef virsh-domain.c: Switch to C99 initialization of vshCmdOptDef virsh-domain-monitor.c: Switch to C99 initialization of vshCmdOptDef virsh-host.c: Switch to C99 initialization of vshCmdOptDef virsh-interface.c: Switch to C99 initialization of vshCmdOptDef virsh-network.c: Switch to C99 initialization of vshCmdOptDef virsh-nodedev.c: Switch to C99 initialization of vshCmdOptDef virsh-nwfilter.c: Switch to C99 initialization of vshCmdOptDef virsh-pool.c: Switch to C99 initialization of vshCmdOptDef virsh-secret.c: Switch to C99 initialization of vshCmdOptDef virsh-snapshot.c: Switch to C99 initialization of vshCmdOptDef virsh-volume.c: Switch to C99 initialization of vshCmdOptDef tools/virsh-domain-monitor.c | 279 +++-- tools/virsh-domain.c | 2299 +++++++++++++++++++++++++++++++++--------- tools/virsh-host.c | 102 +- tools/virsh-interface.c | 138 ++- tools/virsh-network.c | 193 +++- tools/virsh-nodedev.c | 64 +- tools/virsh-nwfilter.c | 34 +- tools/virsh-pool.c | 286 ++++-- tools/virsh-secret.c | 72 +- tools/virsh-snapshot.c | 452 +++++++-- tools/virsh-volume.c | 368 +++++-- tools/virsh.c | 62 +- 12 files changed, 3406 insertions(+), 943 deletions(-) -- 1.8.0.2

--- tools/virsh.c | 62 ++++++++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 51 insertions(+), 11 deletions(-) diff --git a/tools/virsh.c b/tools/virsh.c index 283194a..a764b3e 100644 --- a/tools/virsh.c +++ b/tools/virsh.c @@ -447,8 +447,16 @@ static const vshCmdInfo info_help[] = { }; static const vshCmdOptDef opts_help[] = { - {"command", VSH_OT_DATA, 0, N_("Prints global help, command specific help, or help for a group of related commands")}, - {NULL, 0, 0, NULL} + {.name = "command", + .type = VSH_OT_DATA, + .flags = 0, + .help = N_("Prints global help, command specific help, or help for a group of related commands") + }, + {.name = NULL, + .type = 0, + .flags = 0, + .help = NULL + } }; static bool @@ -698,8 +706,16 @@ static const vshCmdInfo info_cd[] = { }; static const vshCmdOptDef opts_cd[] = { - {"dir", VSH_OT_DATA, 0, N_("directory to switch to (default: home or else root)")}, - {NULL, 0, 0, NULL} + {.name = "dir", + .type = VSH_OT_DATA, + .flags = 0, + .help = N_("directory to switch to (default: home or else root)") + }, + {.name = NULL, + .type = 0, + .flags = 0, + .help = NULL + } }; static bool @@ -770,11 +786,31 @@ static const vshCmdInfo info_echo[] = { }; static const vshCmdOptDef opts_echo[] = { - {"shell", VSH_OT_BOOL, 0, N_("escape for shell use")}, - {"xml", VSH_OT_BOOL, 0, N_("escape for XML use")}, - {"str", VSH_OT_ALIAS, 0, "string"}, - {"string", VSH_OT_ARGV, 0, N_("arguments to echo")}, - {NULL, 0, 0, NULL} + {.name = "shell", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("escape for shell use") + }, + {.name = "xml", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("escape for XML use") + }, + {.name = "str", + .type = VSH_OT_ALIAS, + .flags = 0, + .help = "string" + }, + {.name = "string", + .type = VSH_OT_ARGV, + .flags = 0, + .help = N_("arguments to echo") + }, + {.name = NULL, + .type = 0, + .flags = 0, + .help = NULL + } }; /* Exists mainly for debugging virsh, but also handy for adding back @@ -923,8 +959,12 @@ vshCmddefOptParse(const vshCmdDef *cmd, uint32_t *opts_need_arg, return 0; } -static vshCmdOptDef helpopt = {"help", VSH_OT_BOOL, 0, - N_("print help for this function")}; +static vshCmdOptDef helpopt = { + .name = "help", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("print help for this function") +}; static const vshCmdOptDef * vshCmddefGetOption(vshControl *ctl, const vshCmdDef *cmd, const char *name, uint32_t *opts_seen, int *opt_index) -- 1.8.0.2

On Mon, Jan 14, 2013 at 9:59 AM, Michal Privoznik <mprivozn@redhat.com> wrote:
--- tools/virsh.c | 62 ++++++++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 51 insertions(+), 11 deletions(-)
diff --git a/tools/virsh.c b/tools/virsh.c index 283194a..a764b3e 100644 --- a/tools/virsh.c +++ b/tools/virsh.c @@ -447,8 +447,16 @@ static const vshCmdInfo info_help[] = { };
static const vshCmdOptDef opts_help[] = { - {"command", VSH_OT_DATA, 0, N_("Prints global help, command specific help, or help for a group of related commands")}, - {NULL, 0, 0, NULL} + {.name = "command", + .type = VSH_OT_DATA, + .flags = 0, + .help = N_("Prints global help, command specific help, or help for a group of related commands") + }, + {.name = NULL, + .type = 0, + .flags = 0, + .help = NULL + } };
static bool @@ -698,8 +706,16 @@ static const vshCmdInfo info_cd[] = { };
static const vshCmdOptDef opts_cd[] = { - {"dir", VSH_OT_DATA, 0, N_("directory to switch to (default: home or else root)")}, - {NULL, 0, 0, NULL} + {.name = "dir", + .type = VSH_OT_DATA, + .flags = 0, + .help = N_("directory to switch to (default: home or else root)") + }, + {.name = NULL, + .type = 0, + .flags = 0, + .help = NULL + } };
static bool @@ -770,11 +786,31 @@ static const vshCmdInfo info_echo[] = { };
static const vshCmdOptDef opts_echo[] = { - {"shell", VSH_OT_BOOL, 0, N_("escape for shell use")}, - {"xml", VSH_OT_BOOL, 0, N_("escape for XML use")}, - {"str", VSH_OT_ALIAS, 0, "string"}, - {"string", VSH_OT_ARGV, 0, N_("arguments to echo")}, - {NULL, 0, 0, NULL} + {.name = "shell", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("escape for shell use") + }, + {.name = "xml", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("escape for XML use") + }, + {.name = "str", + .type = VSH_OT_ALIAS, + .flags = 0, + .help = "string" + }, + {.name = "string", + .type = VSH_OT_ARGV, + .flags = 0, + .help = N_("arguments to echo") + }, + {.name = NULL, + .type = 0, + .flags = 0, + .help = NULL + } };
/* Exists mainly for debugging virsh, but also handy for adding back @@ -923,8 +959,12 @@ vshCmddefOptParse(const vshCmdDef *cmd, uint32_t *opts_need_arg, return 0; }
-static vshCmdOptDef helpopt = {"help", VSH_OT_BOOL, 0, - N_("print help for this function")}; +static vshCmdOptDef helpopt = { + .name = "help", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("print help for this function") +}; static const vshCmdOptDef * vshCmddefGetOption(vshControl *ctl, const vshCmdDef *cmd, const char *name, uint32_t *opts_seen, int *opt_index) -- 1.8.0.2
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
ACK with a caveat. How would you feel about a macro called VSH_CMD_OPT_END that is defined to: {.name = NULL, .type = 0, .flags = 0, .help = NULL } Just a thought to cutdown on the number of changes necessary if/when the members of the struct change. -- Doug Goldstein

On 14.01.2013 17:33, Doug Goldstein wrote:
On Mon, Jan 14, 2013 at 9:59 AM, Michal Privoznik <mprivozn@redhat.com> wrote:
--- tools/virsh.c | 62 ++++++++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 51 insertions(+), 11 deletions(-)
diff --git a/tools/virsh.c b/tools/virsh.c index 283194a..a764b3e 100644 --- a/tools/virsh.c +++ b/tools/virsh.c @@ -447,8 +447,16 @@ static const vshCmdInfo info_help[] = { };
static const vshCmdOptDef opts_help[] = { - {"command", VSH_OT_DATA, 0, N_("Prints global help, command specific help, or help for a group of related commands")}, - {NULL, 0, 0, NULL} + {.name = "command", + .type = VSH_OT_DATA, + .flags = 0, + .help = N_("Prints global help, command specific help, or help for a group of related commands") + }, + {.name = NULL, + .type = 0, + .flags = 0, + .help = NULL + } };
static bool @@ -698,8 +706,16 @@ static const vshCmdInfo info_cd[] = { };
static const vshCmdOptDef opts_cd[] = { - {"dir", VSH_OT_DATA, 0, N_("directory to switch to (default: home or else root)")}, - {NULL, 0, 0, NULL} + {.name = "dir", + .type = VSH_OT_DATA, + .flags = 0, + .help = N_("directory to switch to (default: home or else root)") + }, + {.name = NULL, + .type = 0, + .flags = 0, + .help = NULL + } };
static bool @@ -770,11 +786,31 @@ static const vshCmdInfo info_echo[] = { };
static const vshCmdOptDef opts_echo[] = { - {"shell", VSH_OT_BOOL, 0, N_("escape for shell use")}, - {"xml", VSH_OT_BOOL, 0, N_("escape for XML use")}, - {"str", VSH_OT_ALIAS, 0, "string"}, - {"string", VSH_OT_ARGV, 0, N_("arguments to echo")}, - {NULL, 0, 0, NULL} + {.name = "shell", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("escape for shell use") + }, + {.name = "xml", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("escape for XML use") + }, + {.name = "str", + .type = VSH_OT_ALIAS, + .flags = 0, + .help = "string" + }, + {.name = "string", + .type = VSH_OT_ARGV, + .flags = 0, + .help = N_("arguments to echo") + }, + {.name = NULL, + .type = 0, + .flags = 0, + .help = NULL + } };
/* Exists mainly for debugging virsh, but also handy for adding back @@ -923,8 +959,12 @@ vshCmddefOptParse(const vshCmdDef *cmd, uint32_t *opts_need_arg, return 0; }
-static vshCmdOptDef helpopt = {"help", VSH_OT_BOOL, 0, - N_("print help for this function")}; +static vshCmdOptDef helpopt = { + .name = "help", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("print help for this function") +}; static const vshCmdOptDef * vshCmddefGetOption(vshControl *ctl, const vshCmdDef *cmd, const char *name, uint32_t *opts_seen, int *opt_index) -- 1.8.0.2
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
ACK with a caveat. How would you feel about a macro called VSH_CMD_OPT_END that is defined to:
{.name = NULL, .type = 0, .flags = 0, .help = NULL }
Just a thought to cutdown on the number of changes necessary if/when the members of the struct change.
Oh, I forgot to update this patch. If you take look into next patches, you'll see I am using bare {.name = NULL} which has the same effect as your macro. I'll update this patch accordingly. Michal

On Mon, Jan 14, 2013 at 10:51 AM, Michal Privoznik <mprivozn@redhat.com> wrote:
On 14.01.2013 17:33, Doug Goldstein wrote:
On Mon, Jan 14, 2013 at 9:59 AM, Michal Privoznik <mprivozn@redhat.com> wrote:
--- tools/virsh.c | 62 ++++++++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 51 insertions(+), 11 deletions(-)
diff --git a/tools/virsh.c b/tools/virsh.c index 283194a..a764b3e 100644 --- a/tools/virsh.c +++ b/tools/virsh.c @@ -447,8 +447,16 @@ static const vshCmdInfo info_help[] = { };
static const vshCmdOptDef opts_help[] = { - {"command", VSH_OT_DATA, 0, N_("Prints global help, command specific help, or help for a group of related commands")}, - {NULL, 0, 0, NULL} + {.name = "command", + .type = VSH_OT_DATA, + .flags = 0, + .help = N_("Prints global help, command specific help, or help for a group of related commands") + }, + {.name = NULL, + .type = 0, + .flags = 0, + .help = NULL + } };
static bool @@ -698,8 +706,16 @@ static const vshCmdInfo info_cd[] = { };
static const vshCmdOptDef opts_cd[] = { - {"dir", VSH_OT_DATA, 0, N_("directory to switch to (default: home or else root)")}, - {NULL, 0, 0, NULL} + {.name = "dir", + .type = VSH_OT_DATA, + .flags = 0, + .help = N_("directory to switch to (default: home or else root)") + }, + {.name = NULL, + .type = 0, + .flags = 0, + .help = NULL + } };
static bool @@ -770,11 +786,31 @@ static const vshCmdInfo info_echo[] = { };
static const vshCmdOptDef opts_echo[] = { - {"shell", VSH_OT_BOOL, 0, N_("escape for shell use")}, - {"xml", VSH_OT_BOOL, 0, N_("escape for XML use")}, - {"str", VSH_OT_ALIAS, 0, "string"}, - {"string", VSH_OT_ARGV, 0, N_("arguments to echo")}, - {NULL, 0, 0, NULL} + {.name = "shell", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("escape for shell use") + }, + {.name = "xml", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("escape for XML use") + }, + {.name = "str", + .type = VSH_OT_ALIAS, + .flags = 0, + .help = "string" + }, + {.name = "string", + .type = VSH_OT_ARGV, + .flags = 0, + .help = N_("arguments to echo") + }, + {.name = NULL, + .type = 0, + .flags = 0, + .help = NULL + } };
/* Exists mainly for debugging virsh, but also handy for adding back @@ -923,8 +959,12 @@ vshCmddefOptParse(const vshCmdDef *cmd, uint32_t *opts_need_arg, return 0; }
-static vshCmdOptDef helpopt = {"help", VSH_OT_BOOL, 0, - N_("print help for this function")}; +static vshCmdOptDef helpopt = { + .name = "help", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("print help for this function") +}; static const vshCmdOptDef * vshCmddefGetOption(vshControl *ctl, const vshCmdDef *cmd, const char *name, uint32_t *opts_seen, int *opt_index) -- 1.8.0.2
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
ACK with a caveat. How would you feel about a macro called VSH_CMD_OPT_END that is defined to:
{.name = NULL, .type = 0, .flags = 0, .help = NULL }
Just a thought to cutdown on the number of changes necessary if/when the members of the struct change.
Oh, I forgot to update this patch. If you take look into next patches, you'll see I am using bare
{.name = NULL}
which has the same effect as your macro. I'll update this patch accordingly.
Michal
Works for me. Thanks Michal. -- Doug Goldstein

--- tools/virsh-domain.c | 2299 +++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 1813 insertions(+), 486 deletions(-) diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index e91939c..8165ea6 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -157,11 +157,27 @@ static const vshCmdInfo info_attach_device[] = { }; static const vshCmdOptDef opts_attach_device[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"file", VSH_OT_DATA, VSH_OFLAG_REQ, N_("XML file")}, - {"persistent", VSH_OT_ALIAS, 0, "config"}, - {"config", VSH_OT_BOOL, 0, N_("affect next boot")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "file", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("XML file") + }, + {.name = "persistent", + .type = VSH_OT_ALIAS, + .flags = 0, + .help = "config" + }, + {.name = "config", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("affect next boot") + }, + {.name = NULL} }; static bool @@ -219,25 +235,87 @@ static const vshCmdInfo info_attach_disk[] = { }; static const vshCmdOptDef opts_attach_disk[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"source", VSH_OT_DATA, VSH_OFLAG_REQ | VSH_OFLAG_EMPTY_OK, - N_("source of disk device")}, - {"target", VSH_OT_DATA, VSH_OFLAG_REQ, N_("target of disk device")}, - {"driver", VSH_OT_STRING, 0, N_("driver of disk device")}, - {"subdriver", VSH_OT_STRING, 0, N_("subdriver of disk device")}, - {"cache", VSH_OT_STRING, 0, N_("cache mode of disk device")}, - {"type", VSH_OT_STRING, 0, N_("target device type")}, - {"mode", VSH_OT_STRING, 0, N_("mode of device reading and writing")}, - {"persistent", VSH_OT_ALIAS, 0, "config"}, - {"config", VSH_OT_BOOL, 0, N_("affect next boot")}, - {"sourcetype", VSH_OT_STRING, 0, N_("type of source (block|file)")}, - {"serial", VSH_OT_STRING, 0, N_("serial of disk device")}, - {"shareable", VSH_OT_BOOL, 0, N_("shareable between domains")}, - {"rawio", VSH_OT_BOOL, 0, N_("needs rawio capability")}, - {"address", VSH_OT_STRING, 0, N_("address of disk device")}, - {"multifunction", VSH_OT_BOOL, 0, - N_("use multifunction pci under specified address")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "source", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ | VSH_OFLAG_EMPTY_OK, + .help = N_("source of disk device") + }, + {.name = "target", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("target of disk device") + }, + {.name = "driver", + .type = VSH_OT_STRING, + .flags = 0, + .help = N_("driver of disk device") + }, + {.name = "subdriver", + .type = VSH_OT_STRING, + .flags = 0, + .help = N_("subdriver of disk device") + }, + {.name = "cache", + .type = VSH_OT_STRING, + .flags = 0, + .help = N_("cache mode of disk device") + }, + {.name = "type", + .type = VSH_OT_STRING, + .flags = 0, + .help = N_("target device type") + }, + {.name = "mode", + .type = VSH_OT_STRING, + .flags = 0, + .help = N_("mode of device reading and writing") + }, + {.name = "persistent", + .type = VSH_OT_ALIAS, + .flags = 0, + .help = "config" + }, + {.name = "config", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("affect next boot") + }, + {.name = "sourcetype", + .type = VSH_OT_STRING, + .flags = 0, + .help = N_("type of source (block|file)") + }, + {.name = "serial", + .type = VSH_OT_STRING, + .flags = 0, + .help = N_("serial of disk device") + }, + {.name = "shareable", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("shareable between domains") + }, + {.name = "rawio", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("needs rawio capability") + }, + {.name = "address", + .type = VSH_OT_STRING, + .flags = 0, + .help = N_("address of disk device") + }, + {.name = "multifunction", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("use multifunction pci under specified address") + }, + {.name = NULL} }; enum { @@ -575,18 +653,62 @@ static const vshCmdInfo info_attach_interface[] = { }; static const vshCmdOptDef opts_attach_interface[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"type", VSH_OT_DATA, VSH_OFLAG_REQ, N_("network interface type")}, - {"source", VSH_OT_DATA, VSH_OFLAG_REQ, N_("source of network interface")}, - {"target", VSH_OT_DATA, 0, N_("target network name")}, - {"mac", VSH_OT_DATA, 0, N_("MAC address")}, - {"script", VSH_OT_DATA, 0, N_("script used to bridge network interface")}, - {"model", VSH_OT_DATA, 0, N_("model type")}, - {"persistent", VSH_OT_ALIAS, 0, "config"}, - {"config", VSH_OT_BOOL, 0, N_("affect next boot")}, - {"inbound", VSH_OT_DATA, VSH_OFLAG_NONE, N_("control domain's incoming traffics")}, - {"outbound", VSH_OT_DATA, VSH_OFLAG_NONE, N_("control domain's outgoing traffics")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "type", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("network interface type") + }, + {.name = "source", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("source of network interface") + }, + {.name = "target", + .type = VSH_OT_DATA, + .flags = 0, + .help = N_("target network name") + }, + {.name = "mac", + .type = VSH_OT_DATA, + .flags = 0, + .help = N_("MAC address") + }, + {.name = "script", + .type = VSH_OT_DATA, + .flags = 0, + .help = N_("script used to bridge network interface") + }, + {.name = "model", + .type = VSH_OT_DATA, + .flags = 0, + .help = N_("model type") + }, + {.name = "persistent", + .type = VSH_OT_ALIAS, + .flags = 0, + .help = "config" + }, + {.name = "config", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("affect next boot") + }, + {.name = "inbound", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_NONE, + .help = N_("control domain's incoming traffics") + }, + {.name = "outbound", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_NONE, + .help = N_("control domain's outgoing traffics") + }, + {.name = NULL} }; /* parse inbound and outbound which are in the format of @@ -773,9 +895,17 @@ static const vshCmdInfo info_autostart[] = { }; static const vshCmdOptDef opts_autostart[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"disable", VSH_OT_BOOL, 0, N_("disable autostarting")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "disable", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("disable autostarting") + }, + {.name = NULL} }; static bool @@ -818,30 +948,92 @@ static const vshCmdInfo info_blkdeviotune[] = { }; static const vshCmdOptDef opts_blkdeviotune[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"device", VSH_OT_DATA, VSH_OFLAG_REQ, N_("block device")}, - {"total_bytes_sec", VSH_OT_ALIAS, 0, "total-bytes-sec"}, - {"total-bytes-sec", VSH_OT_INT, VSH_OFLAG_NONE, - N_("total throughput limit in bytes per second")}, - {"read_bytes_sec", VSH_OT_ALIAS, 0, "read-bytes-sec"}, - {"read-bytes-sec", VSH_OT_INT, VSH_OFLAG_NONE, - N_("read throughput limit in bytes per second")}, - {"write_bytes_sec", VSH_OT_ALIAS, 0, "write-bytes-sec"}, - {"write-bytes-sec", VSH_OT_INT, VSH_OFLAG_NONE, - N_("write throughput limit in bytes per second")}, - {"total_iops_sec", VSH_OT_ALIAS, 0, "total-iops-sec"}, - {"total-iops-sec", VSH_OT_INT, VSH_OFLAG_NONE, - N_("total I/O operations limit per second")}, - {"read_iops_sec", VSH_OT_ALIAS, 0, "read-iops-sec"}, - {"read-iops-sec", VSH_OT_INT, VSH_OFLAG_NONE, - N_("read I/O operations limit per second")}, - {"write_iops_sec", VSH_OT_ALIAS, 0, "write-iops-sec"}, - {"write-iops-sec", VSH_OT_INT, VSH_OFLAG_NONE, - N_("write I/O operations limit per second")}, - {"config", VSH_OT_BOOL, 0, N_("affect next boot")}, - {"live", VSH_OT_BOOL, 0, N_("affect running domain")}, - {"current", VSH_OT_BOOL, 0, N_("affect current domain")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "device", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("block device") + }, + {.name = "total_bytes_sec", + .type = VSH_OT_ALIAS, + .flags = 0, + .help = "total-bytes-sec" + }, + {.name = "total-bytes-sec", + .type = VSH_OT_INT, + .flags = VSH_OFLAG_NONE, + .help = N_("total throughput limit in bytes per second") + }, + {.name = "read_bytes_sec", + .type = VSH_OT_ALIAS, + .flags = 0, + .help = "read-bytes-sec" + }, + {.name = "read-bytes-sec", + .type = VSH_OT_INT, + .flags = VSH_OFLAG_NONE, + .help = N_("read throughput limit in bytes per second") + }, + {.name = "write_bytes_sec", + .type = VSH_OT_ALIAS, + .flags = 0, + .help = "write-bytes-sec" + }, + {.name = "write-bytes-sec", + .type = VSH_OT_INT, + .flags = VSH_OFLAG_NONE, + .help = N_("write throughput limit in bytes per second") + }, + {.name = "total_iops_sec", + .type = VSH_OT_ALIAS, + .flags = 0, + .help = "total-iops-sec" + }, + {.name = "total-iops-sec", + .type = VSH_OT_INT, + .flags = VSH_OFLAG_NONE, + .help = N_("total I/O operations limit per second") + }, + {.name = "read_iops_sec", + .type = VSH_OT_ALIAS, + .flags = 0, + .help = "read-iops-sec" + }, + {.name = "read-iops-sec", + .type = VSH_OT_INT, + .flags = VSH_OFLAG_NONE, + .help = N_("read I/O operations limit per second") + }, + {.name = "write_iops_sec", + .type = VSH_OT_ALIAS, + .flags = 0, + .help = "write-iops-sec" + }, + {.name = "write-iops-sec", + .type = VSH_OT_INT, + .flags = VSH_OFLAG_NONE, + .help = N_("write I/O operations limit per second") + }, + {.name = "config", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("affect next boot") + }, + {.name = "live", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("affect running domain") + }, + {.name = "current", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("affect current domain") + }, + {.name = NULL} }; static bool @@ -1038,15 +1230,37 @@ static const vshCmdInfo info_blkiotune[] = { }; static const vshCmdOptDef opts_blkiotune[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"weight", VSH_OT_INT, VSH_OFLAG_NONE, - N_("IO Weight in range [100, 1000]")}, - {"device-weights", VSH_OT_STRING, VSH_OFLAG_NONE, - N_("per-device IO Weights, in the form of /path/to/device,weight,...")}, - {"config", VSH_OT_BOOL, 0, N_("affect next boot")}, - {"live", VSH_OT_BOOL, 0, N_("affect running domain")}, - {"current", VSH_OT_BOOL, 0, N_("affect current domain")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "weight", + .type = VSH_OT_INT, + .flags = VSH_OFLAG_NONE, + .help = N_("IO Weight in range [100, 1000]") + }, + {.name = "device-weights", + .type = VSH_OT_STRING, + .flags = VSH_OFLAG_NONE, + .help = N_("per-device IO Weights, in the form of /path/to/device,weight,...") + }, + {.name = "config", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("affect next boot") + }, + {.name = "live", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("affect running domain") + }, + {.name = "current", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("affect current domain") + }, + {.name = NULL} }; static bool @@ -1303,21 +1517,57 @@ static const vshCmdInfo info_block_commit[] = { }; static const vshCmdOptDef opts_block_commit[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"path", VSH_OT_DATA, VSH_OFLAG_REQ, N_("fully-qualified path of disk")}, - {"bandwidth", VSH_OT_DATA, VSH_OFLAG_NONE, N_("bandwidth limit in MiB/s")}, - {"base", VSH_OT_DATA, VSH_OFLAG_NONE, - N_("path of base file to commit into (default bottom of chain)")}, - {"shallow", VSH_OT_BOOL, 0, N_("use backing file of top as base")}, - {"top", VSH_OT_DATA, VSH_OFLAG_NONE, - N_("path of top file to commit from (default top of chain)")}, - {"delete", VSH_OT_BOOL, 0, - N_("delete files that were successfully committed")}, - {"wait", VSH_OT_BOOL, 0, N_("wait for job to complete")}, - {"verbose", VSH_OT_BOOL, 0, N_("with --wait, display the progress")}, - {"timeout", VSH_OT_INT, VSH_OFLAG_NONE, - N_("with --wait, abort if copy exceeds timeout (in seconds)")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "path", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("fully-qualified path of disk") + }, + {.name = "bandwidth", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_NONE, + .help = N_("bandwidth limit in MiB/s") + }, + {.name = "base", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_NONE, + .help = N_("path of base file to commit into (default bottom of chain)") + }, + {.name = "shallow", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("use backing file of top as base") + }, + {.name = "top", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_NONE, + .help = N_("path of top file to commit from (default top of chain)") + }, + {.name = "delete", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("delete files that were successfully committed") + }, + {.name = "wait", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("wait for job to complete") + }, + {.name = "verbose", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("with --wait, display the progress") + }, + {.name = "timeout", + .type = VSH_OT_INT, + .flags = VSH_OFLAG_NONE, + .help = N_("with --wait, abort if copy exceeds timeout (in seconds)") + }, + {.name = NULL} }; static bool @@ -1446,22 +1696,72 @@ static const vshCmdInfo info_block_copy[] = { }; static const vshCmdOptDef opts_block_copy[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"path", VSH_OT_DATA, VSH_OFLAG_REQ, N_("fully-qualified path of disk")}, - {"dest", VSH_OT_DATA, VSH_OFLAG_REQ, N_("path of the copy to create")}, - {"bandwidth", VSH_OT_DATA, VSH_OFLAG_NONE, N_("bandwidth limit in MiB/s")}, - {"shallow", VSH_OT_BOOL, 0, N_("make the copy share a backing chain")}, - {"reuse-external", VSH_OT_BOOL, 0, N_("reuse existing destination")}, - {"raw", VSH_OT_BOOL, 0, N_("use raw destination file")}, - {"wait", VSH_OT_BOOL, 0, N_("wait for job to reach mirroring phase")}, - {"verbose", VSH_OT_BOOL, 0, N_("with --wait, display the progress")}, - {"timeout", VSH_OT_INT, VSH_OFLAG_NONE, - N_("with --wait, abort if copy exceeds timeout (in seconds)")}, - {"pivot", VSH_OT_BOOL, 0, N_("with --wait, pivot when mirroring starts")}, - {"finish", VSH_OT_BOOL, 0, N_("with --wait, quit when mirroring starts")}, - {"async", VSH_OT_BOOL, 0, - N_("with --wait, don't wait for cancel to finish")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "path", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("fully-qualified path of disk") + }, + {.name = "dest", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("path of the copy to create") + }, + {.name = "bandwidth", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_NONE, + .help = N_("bandwidth limit in MiB/s") + }, + {.name = "shallow", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("make the copy share a backing chain") + }, + {.name = "reuse-external", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("reuse existing destination") + }, + {.name = "raw", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("use raw destination file") + }, + {.name = "wait", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("wait for job to reach mirroring phase") + }, + {.name = "verbose", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("with --wait, display the progress") + }, + {.name = "timeout", + .type = VSH_OT_INT, + .flags = VSH_OFLAG_NONE, + .help = N_("with --wait, abort if copy exceeds timeout (in seconds)") + }, + {.name = "pivot", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("with --wait, pivot when mirroring starts") + }, + {.name = "finish", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("with --wait, quit when mirroring starts") + }, + {.name = "async", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("with --wait, don't wait for cancel to finish") + }, + {.name = NULL} }; static bool @@ -1604,19 +1904,42 @@ static const vshCmdInfo info_block_job[] = { }; static const vshCmdOptDef opts_block_job[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"path", VSH_OT_DATA, VSH_OFLAG_REQ, N_("fully-qualified path of disk")}, - {"abort", VSH_OT_BOOL, VSH_OFLAG_NONE, - N_("abort the active job on the specified disk")}, - {"async", VSH_OT_BOOL, VSH_OFLAG_NONE, - N_("don't wait for --abort to complete")}, - {"pivot", VSH_OT_BOOL, VSH_OFLAG_NONE, - N_("conclude and pivot a copy job")}, - {"info", VSH_OT_BOOL, VSH_OFLAG_NONE, - N_("get active job information for the specified disk")}, - {"bandwidth", VSH_OT_DATA, VSH_OFLAG_NONE, - N_("set the Bandwidth limit in MiB/s")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "path", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("fully-qualified path of disk") + }, + {.name = "abort", + .type = VSH_OT_BOOL, + .flags = VSH_OFLAG_NONE, + .help = N_("abort the active job on the specified disk") + }, + {.name = "async", + .type = VSH_OT_BOOL, + .flags = VSH_OFLAG_NONE, + .help = N_("don't wait for --abort to complete") + }, + {.name = "pivot", + .type = VSH_OT_BOOL, + .flags = VSH_OFLAG_NONE, + .help = N_("conclude and pivot a copy job") + }, + {.name = "info", + .type = VSH_OT_BOOL, + .flags = VSH_OFLAG_NONE, + .help = N_("get active job information for the specified disk") + }, + {.name = "bandwidth", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_NONE, + .help = N_("set the Bandwidth limit in MiB/s") + }, + {.name = NULL} }; static bool @@ -1680,18 +2003,47 @@ static const vshCmdInfo info_block_pull[] = { }; static const vshCmdOptDef opts_block_pull[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"path", VSH_OT_DATA, VSH_OFLAG_REQ, N_("fully-qualified path of disk")}, - {"bandwidth", VSH_OT_DATA, VSH_OFLAG_NONE, N_("bandwidth limit in MiB/s")}, - {"base", VSH_OT_DATA, VSH_OFLAG_NONE, - N_("path of backing file in chain for a partial pull")}, - {"wait", VSH_OT_BOOL, 0, N_("wait for job to finish")}, - {"verbose", VSH_OT_BOOL, 0, N_("with --wait, display the progress")}, - {"timeout", VSH_OT_INT, VSH_OFLAG_NONE, - N_("with --wait, abort if pull exceeds timeout (in seconds)")}, - {"async", VSH_OT_BOOL, 0, - N_("with --wait, don't wait for cancel to finish")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "path", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("fully-qualified path of disk") + }, + {.name = "bandwidth", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_NONE, + .help = N_("bandwidth limit in MiB/s") + }, + {.name = "base", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_NONE, + .help = N_("path of backing file in chain for a partial pull") + }, + {.name = "wait", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("wait for job to finish") + }, + {.name = "verbose", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("with --wait, display the progress") + }, + {.name = "timeout", + .type = VSH_OT_INT, + .flags = VSH_OFLAG_NONE, + .help = N_("with --wait, abort if pull exceeds timeout (in seconds)") + }, + {.name = "async", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("with --wait, don't wait for cancel to finish") + }, + {.name = NULL} }; static bool @@ -1819,12 +2171,22 @@ static const vshCmdInfo info_block_resize[] = { }; static const vshCmdOptDef opts_block_resize[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"path", VSH_OT_DATA, VSH_OFLAG_REQ, - N_("Fully-qualified path of block device")}, - {"size", VSH_OT_INT, VSH_OFLAG_REQ, - N_("New size of the block device, as scaled integer (default KiB)")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "path", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("Fully-qualified path of block device") + }, + {.name = "size", + .type = VSH_OT_INT, + .flags = VSH_OFLAG_REQ, + .help = N_("New size of the block device, as scaled integer (default KiB)") + }, + {.name = NULL} }; static bool @@ -1878,13 +2240,27 @@ static const vshCmdInfo info_console[] = { }; static const vshCmdOptDef opts_console[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"devname", VSH_OT_STRING, 0, N_("character device name")}, - {"force", VSH_OT_BOOL, 0, - N_("force console connection (disconnect already connected sessions)")}, - {"safe", VSH_OT_BOOL, 0, - N_("only connect if safe console handling is supported")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "devname", + .type = VSH_OT_STRING, + .flags = 0, + .help = N_("character device name") + }, + {.name = "force", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("force console connection (disconnect already connected sessions)") + }, + {.name = "safe", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("only connect if safe console handling is supported") + }, + {.name = NULL} }; static bool @@ -1961,12 +2337,32 @@ static const vshCmdInfo info_domif_setlink[] = { }; static const vshCmdOptDef opts_domif_setlink[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"interface", VSH_OT_DATA, VSH_OFLAG_REQ, N_("interface device (MAC Address)")}, - {"state", VSH_OT_DATA, VSH_OFLAG_REQ, N_("new state of the device")}, - {"persistent", VSH_OT_ALIAS, 0, "config"}, - {"config", VSH_OT_BOOL, 0, N_("affect next boot")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "interface", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("interface device (MAC Address)") + }, + {.name = "state", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("new state of the device") + }, + {.name = "persistent", + .type = VSH_OT_ALIAS, + .flags = 0, + .help = "config" + }, + {.name = "config", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("affect next boot") + }, + {.name = NULL} }; static bool @@ -2135,14 +2531,42 @@ static const vshCmdInfo info_domiftune[] = { }; static const vshCmdOptDef opts_domiftune[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"interface", VSH_OT_DATA, VSH_OFLAG_REQ, N_("interface device (MAC Address)")}, - {"inbound", VSH_OT_DATA, VSH_OFLAG_NONE, N_("control domain's incoming traffics")}, - {"outbound", VSH_OT_DATA, VSH_OFLAG_NONE, N_("control domain's outgoing traffics")}, - {"config", VSH_OT_BOOL, VSH_OFLAG_NONE, N_("affect next boot")}, - {"live", VSH_OT_BOOL, VSH_OFLAG_NONE, N_("affect running domain")}, - {"current", VSH_OT_BOOL, VSH_OFLAG_NONE, N_("affect current domain")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "interface", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("interface device (MAC Address)") + }, + {.name = "inbound", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_NONE, + .help = N_("control domain's incoming traffics") + }, + {.name = "outbound", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_NONE, + .help = N_("control domain's outgoing traffics") + }, + {.name = "config", + .type = VSH_OT_BOOL, + .flags = VSH_OFLAG_NONE, + .help = N_("affect next boot") + }, + {.name = "live", + .type = VSH_OT_BOOL, + .flags = VSH_OFLAG_NONE, + .help = N_("affect running domain") + }, + {.name = "current", + .type = VSH_OT_BOOL, + .flags = VSH_OFLAG_NONE, + .help = N_("affect current domain") + }, + {.name = NULL} }; static bool @@ -2328,8 +2752,12 @@ static const vshCmdInfo info_suspend[] = { }; static const vshCmdOptDef opts_suspend[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = NULL} }; static bool @@ -2366,12 +2794,24 @@ static const vshCmdInfo info_dom_pm_suspend[] = { }; static const vshCmdOptDef opts_dom_pm_suspend[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"duration", VSH_OT_INT, VSH_OFLAG_REQ_OPT, N_("duration in seconds")}, - {"target", VSH_OT_STRING, VSH_OFLAG_REQ, N_("mem(Suspend-to-RAM), " - "disk(Suspend-to-Disk), " - "hybrid(Hybrid-Suspend)")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "duration", + .type = VSH_OT_INT, + .flags = VSH_OFLAG_REQ_OPT, + .help = N_("duration in seconds") + }, + {.name = "target", + .type = VSH_OT_STRING, + .flags = VSH_OFLAG_REQ, + .help = N_("mem(Suspend-to-RAM), " + "disk(Suspend-to-Disk), " + "hybrid(Hybrid-Suspend)") + }, + {.name = NULL} }; static bool @@ -2436,8 +2876,12 @@ static const vshCmdInfo info_dom_pm_wakeup[] = { }; static const vshCmdOptDef opts_dom_pm_wakeup[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = NULL} }; static bool @@ -2478,18 +2922,38 @@ static const vshCmdInfo info_undefine[] = { }; static const vshCmdOptDef opts_undefine[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name or uuid")}, - {"managed-save", VSH_OT_BOOL, 0, N_("remove domain managed state file")}, - {"storage", VSH_OT_DATA, VSH_OFLAG_NONE, - N_("remove associated storage volumes (comma separated list of targets " - "or source paths) (see domblklist)")}, - {"remove-all-storage", VSH_OT_BOOL, 0, - N_("remove all associated storage volumes (use with caution)")}, - {"wipe-storage", VSH_OT_BOOL, VSH_OFLAG_NONE, - N_("wipe data on the removed volumes")}, - {"snapshots-metadata", VSH_OT_BOOL, 0, - N_("remove all domain snapshot metadata, if inactive")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name or uuid") + }, + {.name = "managed-save", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("remove domain managed state file") + }, + {.name = "storage", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_NONE, + .help = N_("remove associated storage volumes (comma separated list of " + "targets or source paths) (see domblklist)") + }, + {.name = "remove-all-storage", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("remove all associated storage volumes (use with caution)") + }, + {.name = "wipe-storage", + .type = VSH_OT_BOOL, + .flags = VSH_OFLAG_NONE, + .help = N_("wipe data on the removed volumes") + }, + {.name = "snapshots-metadata", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("remove all domain snapshot metadata, if inactive") + }, + {.name = NULL} }; typedef struct { @@ -2818,18 +3282,39 @@ static const vshCmdInfo info_start[] = { }; static const vshCmdOptDef opts_start[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("name of the inactive domain")}, + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("name of the inactive domain") + }, #ifndef WIN32 - {"console", VSH_OT_BOOL, 0, N_("attach to console after creation")}, + {.name = "console", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("attach to console after creation") + }, #endif - {"paused", VSH_OT_BOOL, 0, N_("leave the guest paused after creation")}, - {"autodestroy", VSH_OT_BOOL, 0, - N_("automatically destroy the guest when virsh disconnects")}, - {"bypass-cache", VSH_OT_BOOL, 0, - N_("avoid file system cache when loading")}, - {"force-boot", VSH_OT_BOOL, 0, - N_("force fresh boot by discarding any managed save")}, - {NULL, 0, 0, NULL} + {.name = "paused", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("leave the guest paused after creation") + }, + {.name = "autodestroy", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("automatically destroy the guest when virsh disconnects") + }, + {.name = "bypass-cache", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("avoid file system cache when loading") + }, + {.name = "force-boot", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("force fresh boot by discarding any managed save") + }, + {.name = NULL} }; static bool @@ -2917,15 +3402,42 @@ static const vshCmdInfo info_save[] = { }; static const vshCmdOptDef opts_save[] = { - {"bypass-cache", VSH_OT_BOOL, 0, N_("avoid file system cache when saving")}, - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"file", VSH_OT_DATA, VSH_OFLAG_REQ, N_("where to save the data")}, - {"xml", VSH_OT_STRING, 0, - N_("filename containing updated XML for the target")}, - {"running", VSH_OT_BOOL, 0, N_("set domain to be running on restore")}, - {"paused", VSH_OT_BOOL, 0, N_("set domain to be paused on restore")}, - {"verbose", VSH_OT_BOOL, 0, N_("display the progress of save")}, - {NULL, 0, 0, NULL} + {.name = "bypass-cache", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("avoid file system cache when saving") + }, + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "file", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("where to save the data") + }, + {.name = "xml", + .type = VSH_OT_STRING, + .flags = 0, + .help = N_("filename containing updated XML for the target") + }, + {.name = "running", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("set domain to be running on restore") + }, + {.name = "paused", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("set domain to be paused on restore") + }, + {.name = "verbose", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("display the progress of save") + }, + {.name = NULL} }; static void @@ -3140,9 +3652,17 @@ static const vshCmdInfo info_save_image_dumpxml[] = { }; static const vshCmdOptDef opts_save_image_dumpxml[] = { - {"file", VSH_OT_DATA, VSH_OFLAG_REQ, N_("saved state file to read")}, - {"security-info", VSH_OT_BOOL, 0, N_("include security sensitive information in XML dump")}, - {NULL, 0, 0, NULL} + {.name = "file", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("saved state file to read") + }, + {.name = "security-info", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("include security sensitive information in XML dump") + }, + {.name = NULL} }; static bool @@ -3181,12 +3701,27 @@ static const vshCmdInfo info_save_image_define[] = { }; static const vshCmdOptDef opts_save_image_define[] = { - {"file", VSH_OT_DATA, VSH_OFLAG_REQ, N_("saved state file to modify")}, - {"xml", VSH_OT_STRING, VSH_OFLAG_REQ, - N_("filename containing updated XML for the target")}, - {"running", VSH_OT_BOOL, 0, N_("set domain to be running on restore")}, - {"paused", VSH_OT_BOOL, 0, N_("set domain to be paused on restore")}, - {NULL, 0, 0, NULL} + {.name = "file", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("saved state file to modify") + }, + {.name = "xml", + .type = VSH_OT_STRING, + .flags = VSH_OFLAG_REQ, + .help = N_("filename containing updated XML for the target") + }, + {.name = "running", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("set domain to be running on restore") + }, + {.name = "paused", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("set domain to be paused on restore") + }, + {.name = NULL} }; static bool @@ -3237,10 +3772,22 @@ static const vshCmdInfo info_save_image_edit[] = { }; static const vshCmdOptDef opts_save_image_edit[] = { - {"file", VSH_OT_DATA, VSH_OFLAG_REQ, N_("saved state file to edit")}, - {"running", VSH_OT_BOOL, 0, N_("set domain to be running on restore")}, - {"paused", VSH_OT_BOOL, 0, N_("set domain to be paused on restore")}, - {NULL, 0, 0, NULL} + {.name = "file", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("saved state file to edit") + }, + {.name = "running", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("set domain to be running on restore") + }, + {.name = "paused", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("set domain to be paused on restore") + }, + {.name = NULL} }; static bool @@ -3299,12 +3846,32 @@ static const vshCmdInfo info_managedsave[] = { }; static const vshCmdOptDef opts_managedsave[] = { - {"bypass-cache", VSH_OT_BOOL, 0, N_("avoid file system cache when saving")}, - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"running", VSH_OT_BOOL, 0, N_("set domain to be running on next start")}, - {"paused", VSH_OT_BOOL, 0, N_("set domain to be paused on next start")}, - {"verbose", VSH_OT_BOOL, 0, N_("display the progress of save")}, - {NULL, 0, 0, NULL} + {.name = "bypass-cache", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("avoid file system cache when saving") + }, + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "running", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("set domain to be running on next start") + }, + {.name = "paused", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("set domain to be paused on next start") + }, + {.name = "verbose", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("display the progress of save") + }, + {.name = NULL} }; static void @@ -3403,8 +3970,12 @@ static const vshCmdInfo info_managedsaveremove[] = { }; static const vshCmdOptDef opts_managedsaveremove[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = NULL} }; static bool @@ -3454,14 +4025,42 @@ static const vshCmdInfo info_schedinfo[] = { }; static const vshCmdOptDef opts_schedinfo[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"set", VSH_OT_STRING, VSH_OFLAG_NONE, N_("parameter=value")}, - {"weight", VSH_OT_INT, VSH_OFLAG_NONE, N_("weight for XEN_CREDIT")}, - {"cap", VSH_OT_INT, VSH_OFLAG_NONE, N_("cap for XEN_CREDIT")}, - {"current", VSH_OT_BOOL, 0, N_("get/set current scheduler info")}, - {"config", VSH_OT_BOOL, 0, N_("get/set value to be used on next boot")}, - {"live", VSH_OT_BOOL, 0, N_("get/set value from running domain")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "set", + .type = VSH_OT_STRING, + .flags = VSH_OFLAG_NONE, + .help = N_("parameter=value") + }, + {.name = "weight", + .type = VSH_OT_INT, + .flags = VSH_OFLAG_NONE, + .help = N_("weight for XEN_CREDIT") + }, + {.name = "cap", + .type = VSH_OT_INT, + .flags = VSH_OFLAG_NONE, + .help = N_("cap for XEN_CREDIT") + }, + {.name = "current", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("get/set current scheduler info") + }, + {.name = "config", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("get/set value to be used on next boot") + }, + {.name = "live", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("get/set value from running domain") + }, + {.name = NULL} }; static int @@ -3675,14 +4274,32 @@ static const vshCmdInfo info_restore[] = { }; static const vshCmdOptDef opts_restore[] = { - {"file", VSH_OT_DATA, VSH_OFLAG_REQ, N_("the state to restore")}, - {"bypass-cache", VSH_OT_BOOL, 0, - N_("avoid file system cache when restoring")}, - {"xml", VSH_OT_STRING, 0, - N_("filename containing updated XML for the target")}, - {"running", VSH_OT_BOOL, 0, N_("restore domain into running state")}, - {"paused", VSH_OT_BOOL, 0, N_("restore domain into paused state")}, - {NULL, 0, 0, NULL} + {.name = "file", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("the state to restore") + }, + {.name = "bypass-cache", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("avoid file system cache when restoring") + }, + {.name = "xml", + .type = VSH_OT_STRING, + .flags = 0, + .help = N_("filename containing updated XML for the target") + }, + {.name = "running", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("restore domain into running state") + }, + {.name = "paused", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("restore domain into paused state") + }, + {.name = NULL} }; static bool @@ -3738,16 +4355,47 @@ static const vshCmdInfo info_dump[] = { }; static const vshCmdOptDef opts_dump[] = { - {"live", VSH_OT_BOOL, 0, N_("perform a live core dump if supported")}, - {"crash", VSH_OT_BOOL, 0, N_("crash the domain after core dump")}, - {"bypass-cache", VSH_OT_BOOL, 0, - N_("avoid file system cache when saving")}, - {"reset", VSH_OT_BOOL, 0, N_("reset the domain after core dump")}, - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"file", VSH_OT_DATA, VSH_OFLAG_REQ, N_("where to dump the core")}, - {"verbose", VSH_OT_BOOL, 0, N_("display the progress of dump")}, - {"memory-only", VSH_OT_BOOL, 0, N_("dump domain's memory only")}, - {NULL, 0, 0, NULL} + {.name = "live", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("perform a live core dump if supported") + }, + {.name = "crash", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("crash the domain after core dump") + }, + {.name = "bypass-cache", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("avoid file system cache when saving") + }, + {.name = "reset", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("reset the domain after core dump") + }, + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "file", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("where to dump the core") + }, + {.name = "verbose", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("display the progress of dump") + }, + {.name = "memory-only", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("dump domain's memory only") + }, + {.name = NULL} }; static void @@ -3855,10 +4503,22 @@ static const vshCmdInfo info_screenshot[] = { }; static const vshCmdOptDef opts_screenshot[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"file", VSH_OT_DATA, VSH_OFLAG_NONE, N_("where to store the screenshot")}, - {"screen", VSH_OT_INT, VSH_OFLAG_NONE, N_("ID of a screen to take screenshot of")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "file", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_NONE, + .help = N_("where to store the screenshot") + }, + {.name = "screen", + .type = VSH_OT_INT, + .flags = VSH_OFLAG_NONE, + .help = N_("ID of a screen to take screenshot of") + }, + {.name = NULL} }; /** @@ -3990,8 +4650,12 @@ static const vshCmdInfo info_resume[] = { }; static const vshCmdOptDef opts_resume[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = NULL} }; static bool @@ -4025,9 +4689,17 @@ static const vshCmdInfo info_shutdown[] = { }; static const vshCmdOptDef opts_shutdown[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"mode", VSH_OT_STRING, VSH_OFLAG_NONE, N_("shutdown mode: acpi|agent")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "mode", + .type = VSH_OT_STRING, + .flags = VSH_OFLAG_NONE, + .help = N_("shutdown mode: acpi|agent") + }, + {.name = NULL} }; static bool @@ -4102,9 +4774,17 @@ static const vshCmdInfo info_reboot[] = { }; static const vshCmdOptDef opts_reboot[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"mode", VSH_OT_STRING, VSH_OFLAG_NONE, N_("shutdown mode: acpi|agent")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "mode", + .type = VSH_OT_STRING, + .flags = VSH_OFLAG_NONE, + .help = N_("shutdown mode: acpi|agent") + }, + {.name = NULL} }; static bool @@ -4174,8 +4854,12 @@ static const vshCmdInfo info_reset[] = { }; static const vshCmdOptDef opts_reset[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = NULL} }; static bool @@ -4209,8 +4893,12 @@ static const vshCmdInfo info_domjobinfo[] = { }; static const vshCmdOptDef opts_domjobinfo[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = NULL} }; static bool @@ -4288,8 +4976,12 @@ static const vshCmdInfo info_domjobabort[] = { }; static const vshCmdOptDef opts_domjobabort[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = NULL} }; static bool @@ -4318,8 +5010,12 @@ static const vshCmdInfo info_maxvcpus[] = { }; static const vshCmdOptDef opts_maxvcpus[] = { - {"type", VSH_OT_STRING, 0, N_("domain type")}, - {NULL, 0, 0, NULL} + {.name = "type", + .type = VSH_OT_STRING, + .flags = 0, + .help = N_("domain type") + }, + {.name = NULL} }; static bool @@ -4351,14 +5047,37 @@ static const vshCmdInfo info_vcpucount[] = { }; static const vshCmdOptDef opts_vcpucount[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"maximum", VSH_OT_BOOL, 0, N_("get maximum cap on vcpus")}, - {"active", VSH_OT_BOOL, 0, N_("get number of currently active vcpus")}, - {"live", VSH_OT_BOOL, 0, N_("get value from running domain")}, - {"config", VSH_OT_BOOL, 0, N_("get value to be used on next boot")}, - {"current", VSH_OT_BOOL, 0, - N_("get value according to current domain state")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "maximum", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("get maximum cap on vcpus") + }, + {.name = "active", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("get number of currently active vcpus") + }, + {.name = "live", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("get value from running domain") + }, + {.name = "config", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("get value to be used on next boot") + }, + {.name = "current", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("get value according to current domain state") + }, + {.name = NULL} }; static bool @@ -4551,8 +5270,12 @@ static const vshCmdInfo info_vcpuinfo[] = { }; static const vshCmdOptDef opts_vcpuinfo[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = NULL} }; static bool @@ -4652,14 +5375,37 @@ static const vshCmdInfo info_vcpupin[] = { }; static const vshCmdOptDef opts_vcpupin[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"vcpu", VSH_OT_INT, 0, N_("vcpu number")}, - {"cpulist", VSH_OT_DATA, VSH_OFLAG_EMPTY_OK, - N_("host cpu number(s) to set, or omit option to query")}, - {"config", VSH_OT_BOOL, 0, N_("affect next boot")}, - {"live", VSH_OT_BOOL, 0, N_("affect running domain")}, - {"current", VSH_OT_BOOL, 0, N_("affect current domain")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "vcpu", + .type = VSH_OT_INT, + .flags = 0, + .help = N_("vcpu number") + }, + {.name = "cpulist", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_EMPTY_OK, + .help = N_("host cpu number(s) to set, or omit option to query") + }, + {.name = "config", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("affect next boot") + }, + {.name = "live", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("affect running domain") + }, + {.name = "current", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("affect current domain") + }, + {.name = NULL} }; /* @@ -4910,13 +5656,32 @@ static const vshCmdInfo info_emulatorpin[] = { }; static const vshCmdOptDef opts_emulatorpin[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"cpulist", VSH_OT_DATA, VSH_OFLAG_EMPTY_OK, - N_("host cpu number(s) to set, or omit option to query")}, - {"config", VSH_OT_BOOL, 0, N_("affect next boot")}, - {"live", VSH_OT_BOOL, 0, N_("affect running domain")}, - {"current", VSH_OT_BOOL, 0, N_("affect current domain")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "cpulist", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_EMPTY_OK, + .help = N_("host cpu number(s) to set, or omit option to query") + }, + {.name = "config", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("affect next boot") + }, + {.name = "live", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("affect running domain") + }, + {.name = "current", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("affect current domain") + }, + {.name = NULL} }; static bool @@ -5092,13 +5857,37 @@ static const vshCmdInfo info_setvcpus[] = { }; static const vshCmdOptDef opts_setvcpus[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"count", VSH_OT_INT, VSH_OFLAG_REQ, N_("number of virtual CPUs")}, - {"maximum", VSH_OT_BOOL, 0, N_("set maximum limit on next boot")}, - {"config", VSH_OT_BOOL, 0, N_("affect next boot")}, - {"live", VSH_OT_BOOL, 0, N_("affect running domain")}, - {"current", VSH_OT_BOOL, 0, N_("affect current domain")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "count", + .type = VSH_OT_INT, + .flags = VSH_OFLAG_REQ, + .help = N_("number of virtual CPUs") + }, + {.name = "maximum", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("set maximum limit on next boot") + }, + {.name = "config", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("affect next boot") + }, + {.name = "live", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("affect running domain") + }, + {.name = "current", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("affect current domain") + }, + {.name = NULL} }; static bool @@ -5183,8 +5972,12 @@ static const vshCmdInfo info_cpu_compare[] = { }; static const vshCmdOptDef opts_cpu_compare[] = { - {"file", VSH_OT_DATA, VSH_OFLAG_REQ, N_("file containing an XML CPU description")}, - {NULL, 0, 0, NULL} + {.name = "file", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("file containing an XML CPU description") + }, + {.name = NULL} }; static bool @@ -5280,8 +6073,12 @@ static const vshCmdInfo info_cpu_baseline[] = { }; static const vshCmdOptDef opts_cpu_baseline[] = { - {"file", VSH_OT_DATA, VSH_OFLAG_REQ, N_("file containing XML CPU descriptions")}, - {NULL, 0, 0, NULL} + {.name = "file", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("file containing XML CPU descriptions") + }, + {.name = NULL} }; static bool @@ -5382,11 +6179,27 @@ static const vshCmdInfo info_cpu_stats[] = { }; static const vshCmdOptDef opts_cpu_stats[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"total", VSH_OT_BOOL, 0, N_("Show total statistics only")}, - {"start", VSH_OT_INT, 0, N_("Show statistics from this CPU")}, - {"count", VSH_OT_INT, 0, N_("Number of shown CPUs at most")}, - {NULL, 0, 0, NULL}, + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "total", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("Show total statistics only") + }, + {.name = "start", + .type = VSH_OT_INT, + .flags = 0, + .help = N_("Show statistics from this CPU") + }, + {.name = "count", + .type = VSH_OT_INT, + .flags = 0, + .help = N_("Number of shown CPUs at most") + }, + {.name = NULL}, }; static bool @@ -5536,13 +6349,29 @@ static const vshCmdInfo info_create[] = { }; static const vshCmdOptDef opts_create[] = { - {"file", VSH_OT_DATA, VSH_OFLAG_REQ, N_("file containing an XML domain description")}, + {.name = "file", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("file containing an XML domain description") + }, #ifndef WIN32 - {"console", VSH_OT_BOOL, 0, N_("attach to console after creation")}, + {.name = "console", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("attach to console after creation") + }, #endif - {"paused", VSH_OT_BOOL, 0, N_("leave the guest paused after creation")}, - {"autodestroy", VSH_OT_BOOL, 0, N_("automatically destroy the guest when virsh disconnects")}, - {NULL, 0, 0, NULL} + {.name = "paused", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("leave the guest paused after creation") + }, + {.name = "autodestroy", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("automatically destroy the guest when virsh disconnects") + }, + {.name = NULL} }; static bool @@ -5596,8 +6425,12 @@ static const vshCmdInfo info_define[] = { }; static const vshCmdOptDef opts_define[] = { - {"file", VSH_OT_DATA, VSH_OFLAG_REQ, N_("file containing an XML domain description")}, - {NULL, 0, 0, NULL} + {.name = "file", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("file containing an XML domain description") + }, + {.name = NULL} }; static bool @@ -5639,9 +6472,17 @@ static const vshCmdInfo info_destroy[] = { }; static const vshCmdOptDef opts_destroy[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"graceful", VSH_OT_BOOL, VSH_OFLAG_NONE, N_("terminate gracefully")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "graceful", + .type = VSH_OT_BOOL, + .flags = VSH_OFLAG_NONE, + .help = N_("terminate gracefully") + }, + {.name = NULL} }; static bool @@ -5685,14 +6526,42 @@ static const vshCmdInfo info_desc[] = { }; static const vshCmdOptDef opts_desc[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"live", VSH_OT_BOOL, 0, N_("modify/get running state")}, - {"config", VSH_OT_BOOL, 0, N_("modify/get persistent configuration")}, - {"current", VSH_OT_BOOL, 0, N_("modify/get current state configuration")}, - {"title", VSH_OT_BOOL, 0, N_("modify/get the title instead of description")}, - {"edit", VSH_OT_BOOL, 0, N_("open an editor to modify the description")}, - {"new-desc", VSH_OT_ARGV, 0, N_("message")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "live", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("modify/get running state") + }, + {.name = "config", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("modify/get persistent configuration") + }, + {.name = "current", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("modify/get current state configuration") + }, + {.name = "title", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("modify/get the title instead of description") + }, + {.name = "edit", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("open an editor to modify the description") + }, + {.name = "new-desc", + .type = VSH_OT_ARGV, + .flags = 0, + .help = N_("message") + }, + {.name = NULL} }; static bool @@ -5838,8 +6707,12 @@ static const vshCmdInfo info_inject_nmi[] = { }; static const vshCmdOptDef opts_inject_nmi[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = NULL} }; static bool @@ -5868,13 +6741,27 @@ static const vshCmdInfo info_send_key[] = { }; static const vshCmdOptDef opts_send_key[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"codeset", VSH_OT_STRING, VSH_OFLAG_REQ_OPT, - N_("the codeset of keycodes, default:linux")}, - {"holdtime", VSH_OT_INT, VSH_OFLAG_REQ_OPT, - N_("the time (in milliseconds) how long the keys will be held")}, - {"keycode", VSH_OT_ARGV, VSH_OFLAG_REQ, N_("the key code")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "codeset", + .type = VSH_OT_STRING, + .flags = VSH_OFLAG_REQ_OPT, + .help = N_("the codeset of keycodes, default:linux") + }, + {.name = "holdtime", + .type = VSH_OT_INT, + .flags = VSH_OFLAG_REQ_OPT, + .help = N_("the time (in milliseconds) how long the keys will be held") + }, + {.name = "keycode", + .type = VSH_OT_ARGV, + .flags = VSH_OFLAG_REQ, + .help = N_("the key code") + }, + {.name = NULL} }; static int @@ -5950,10 +6837,22 @@ static const vshCmdInfo info_send_process_signal[] = { }; static const vshCmdOptDef opts_send_process_signal[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"pid", VSH_OT_DATA, VSH_OFLAG_REQ, N_("the process ID") }, - {"signame", VSH_OT_DATA, VSH_OFLAG_REQ, N_("the signal number or name") }, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "pid", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("the process ID") + }, + {.name = "signame", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("the signal number or name") + }, + {.name = NULL} }; VIR_ENUM_DECL(virDomainProcessSignal) @@ -6053,14 +6952,37 @@ static const vshCmdInfo info_setmem[] = { }; static const vshCmdOptDef opts_setmem[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"kilobytes", VSH_OT_ALIAS, 0, "size"}, - {"size", VSH_OT_INT, VSH_OFLAG_REQ, - N_("new memory size, as scaled integer (default KiB)")}, - {"config", VSH_OT_BOOL, 0, N_("affect next boot")}, - {"live", VSH_OT_BOOL, 0, N_("affect running domain")}, - {"current", VSH_OT_BOOL, 0, N_("affect current domain")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "kilobytes", + .type = VSH_OT_ALIAS, + .flags = 0, + .help = "size" + }, + {.name = "size", + .type = VSH_OT_INT, + .flags = VSH_OFLAG_REQ, + .help = N_("new memory size, as scaled integer (default KiB)") + }, + {.name = "config", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("affect next boot") + }, + {.name = "live", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("affect running domain") + }, + {.name = "current", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("affect current domain") + }, + {.name = NULL} }; static bool @@ -6132,14 +7054,37 @@ static const vshCmdInfo info_setmaxmem[] = { }; static const vshCmdOptDef opts_setmaxmem[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"kilobytes", VSH_OT_ALIAS, 0, "size"}, - {"size", VSH_OT_INT, VSH_OFLAG_REQ, - N_("new maximum memory size, as scaled integer (default KiB)")}, - {"config", VSH_OT_BOOL, 0, N_("affect next boot")}, - {"live", VSH_OT_BOOL, 0, N_("affect running domain")}, - {"current", VSH_OT_BOOL, 0, N_("affect current domain")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "kilobytes", + .type = VSH_OT_ALIAS, + .flags = 0, + .help = "size" + }, + {.name = "size", + .type = VSH_OT_INT, + .flags = VSH_OFLAG_REQ, + .help = N_("new maximum memory size, as scaled integer (default KiB)") + }, + {.name = "config", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("affect next boot") + }, + {.name = "live", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("affect running domain") + }, + {.name = "current", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("affect current domain") + }, + {.name = NULL} }; static bool @@ -6215,19 +7160,47 @@ static const vshCmdInfo info_memtune[] = { }; static const vshCmdOptDef opts_memtune[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"hard-limit", VSH_OT_INT, VSH_OFLAG_NONE, - N_("Max memory, as scaled integer (default KiB)")}, - {"soft-limit", VSH_OT_INT, VSH_OFLAG_NONE, - N_("Memory during contention, as scaled integer (default KiB)")}, - {"swap-hard-limit", VSH_OT_INT, VSH_OFLAG_NONE, - N_("Max memory plus swap, as scaled integer (default KiB)")}, - {"min-guarantee", VSH_OT_INT, VSH_OFLAG_NONE, - N_("Min guaranteed memory, as scaled integer (default KiB)")}, - {"config", VSH_OT_BOOL, 0, N_("affect next boot")}, - {"live", VSH_OT_BOOL, 0, N_("affect running domain")}, - {"current", VSH_OT_BOOL, 0, N_("affect current domain")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "hard-limit", + .type = VSH_OT_INT, + .flags = VSH_OFLAG_NONE, + .help = N_("Max memory, as scaled integer (default KiB)") + }, + {.name = "soft-limit", + .type = VSH_OT_INT, + .flags = VSH_OFLAG_NONE, + .help = N_("Memory during contention, as scaled integer (default KiB)") + }, + {.name = "swap-hard-limit", + .type = VSH_OT_INT, + .flags = VSH_OFLAG_NONE, + .help = N_("Max memory plus swap, as scaled integer (default KiB)") + }, + {.name = "min-guarantee", + .type = VSH_OT_INT, + .flags = VSH_OFLAG_NONE, + .help = N_("Min guaranteed memory, as scaled integer (default KiB)") + }, + {.name = "config", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("affect next boot") + }, + {.name = "live", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("affect running domain") + }, + {.name = "current", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("affect current domain") + }, + {.name = NULL} }; static int @@ -6416,15 +7389,37 @@ static const vshCmdInfo info_numatune[] = { }; static const vshCmdOptDef opts_numatune[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"mode", VSH_OT_DATA, VSH_OFLAG_NONE, - N_("NUMA mode, one of strict, preferred and interleave")}, - {"nodeset", VSH_OT_DATA, VSH_OFLAG_NONE, - N_("NUMA node selections to set")}, - {"config", VSH_OT_BOOL, 0, N_("affect next boot")}, - {"live", VSH_OT_BOOL, 0, N_("affect running domain")}, - {"current", VSH_OT_BOOL, 0, N_("affect current domain")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "mode", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_NONE, + .help = N_("NUMA mode, one of strict, preferred and interleave") + }, + {.name = "nodeset", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_NONE, + .help = N_("NUMA node selections to set") + }, + {.name = "config", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("affect next boot") + }, + {.name = "live", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("affect running domain") + }, + {.name = "current", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("affect current domain") + }, + {.name = NULL} }; static bool @@ -6567,12 +7562,27 @@ static const vshCmdInfo info_qemu_monitor_command[] = { }; static const vshCmdOptDef opts_qemu_monitor_command[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"hmp", VSH_OT_BOOL, 0, N_("command is in human monitor protocol")}, - {"pretty", VSH_OT_BOOL, 0, - N_("pretty-print any qemu monitor protocol output")}, - {"cmd", VSH_OT_ARGV, VSH_OFLAG_REQ, N_("command")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "hmp", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("command is in human monitor protocol") + }, + {.name = "pretty", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("pretty-print any qemu monitor protocol output") + }, + {.name = "cmd", + .type = VSH_OT_ARGV, + .flags = VSH_OFLAG_REQ, + .help = N_("command") + }, + {.name = NULL} }; static bool @@ -6649,8 +7659,12 @@ static const vshCmdInfo info_qemu_attach[] = { }; static const vshCmdOptDef opts_qemu_attach[] = { - {"pid", VSH_OT_DATA, VSH_OFLAG_REQ, N_("pid")}, - {NULL, 0, 0, NULL} + {.name = "pid", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("pid") + }, + {.name = NULL} }; static bool @@ -6692,12 +7706,32 @@ static const vshCmdInfo info_qemu_agent_command[] = { }; static const vshCmdOptDef opts_qemu_agent_command[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"timeout", VSH_OT_INT, VSH_OFLAG_REQ_OPT, N_("timeout seconds. must be positive.")}, - {"async", VSH_OT_BOOL, 0, N_("execute command without waiting for timeout")}, - {"block", VSH_OT_BOOL, 0, N_("execute command without timeout")}, - {"cmd", VSH_OT_ARGV, VSH_OFLAG_REQ, N_("command")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "timeout", + .type = VSH_OT_INT, + .flags = VSH_OFLAG_REQ_OPT, + .help = N_("timeout seconds. must be positive.") + }, + {.name = "async", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("execute command without waiting for timeout") + }, + {.name = "block", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("execute command without timeout") + }, + {.name = "cmd", + .type = VSH_OT_ARGV, + .flags = VSH_OFLAG_REQ, + .help = N_("command") + }, + {.name = NULL} }; static bool @@ -6780,12 +7814,32 @@ static const vshCmdInfo info_dumpxml[] = { }; static const vshCmdOptDef opts_dumpxml[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"inactive", VSH_OT_BOOL, 0, N_("show inactive defined XML")}, - {"security-info", VSH_OT_BOOL, 0, N_("include security sensitive information in XML dump")}, - {"update-cpu", VSH_OT_BOOL, 0, N_("update guest CPU according to host CPU")}, - {"migratable", VSH_OT_BOOL, 0, N_("provide XML suitable for migrations")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "inactive", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("show inactive defined XML") + }, + {.name = "security-info", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("include security sensitive information in XML dump") + }, + {.name = "update-cpu", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("update guest CPU according to host CPU") + }, + {.name = "migratable", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("provide XML suitable for migrations") + }, + {.name = NULL} }; static bool @@ -6834,9 +7888,17 @@ static const vshCmdInfo info_domxmlfromnative[] = { }; static const vshCmdOptDef opts_domxmlfromnative[] = { - {"format", VSH_OT_DATA, VSH_OFLAG_REQ, N_("source config data format")}, - {"config", VSH_OT_DATA, VSH_OFLAG_REQ, N_("config data file to import from")}, - {NULL, 0, 0, NULL} + {.name = "format", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("source config data format") + }, + {.name = "config", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("config data file to import from") + }, + {.name = NULL} }; static bool @@ -6878,9 +7940,17 @@ static const vshCmdInfo info_domxmltonative[] = { }; static const vshCmdOptDef opts_domxmltonative[] = { - {"format", VSH_OT_DATA, VSH_OFLAG_REQ, N_("target config data type format")}, - {"xml", VSH_OT_DATA, VSH_OFLAG_REQ, N_("xml data file to export from")}, - {NULL, 0, 0, NULL} + {.name = "format", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("target config data type format") + }, + {.name = "xml", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("xml data file to export from") + }, + {.name = NULL} }; static bool @@ -6922,8 +7992,12 @@ static const vshCmdInfo info_domname[] = { }; static const vshCmdOptDef opts_domname[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain id or uuid")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain id or uuid") + }, + {.name = NULL} }; static bool @@ -6950,8 +8024,12 @@ static const vshCmdInfo info_domid[] = { }; static const vshCmdOptDef opts_domid[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name or uuid")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name or uuid") + }, + {.name = NULL} }; static bool @@ -6983,8 +8061,12 @@ static const vshCmdInfo info_domuuid[] = { }; static const vshCmdOptDef opts_domuuid[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain id or name")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain id or name") + }, + {.name = NULL} }; static bool @@ -7016,28 +8098,107 @@ static const vshCmdInfo info_migrate[] = { }; static const vshCmdOptDef opts_migrate[] = { - {"live", VSH_OT_BOOL, 0, N_("live migration")}, - {"offline", VSH_OT_BOOL, 0, N_("offline migration")}, - {"p2p", VSH_OT_BOOL, 0, N_("peer-2-peer migration")}, - {"direct", VSH_OT_BOOL, 0, N_("direct migration")}, - {"tunneled", VSH_OT_ALIAS, 0, "tunnelled"}, - {"tunnelled", VSH_OT_BOOL, 0, N_("tunnelled migration")}, - {"persistent", VSH_OT_BOOL, 0, N_("persist VM on destination")}, - {"undefinesource", VSH_OT_BOOL, 0, N_("undefine VM on source")}, - {"suspend", VSH_OT_BOOL, 0, N_("do not restart the domain on the destination host")}, - {"copy-storage-all", VSH_OT_BOOL, 0, N_("migration with non-shared storage with full disk copy")}, - {"copy-storage-inc", VSH_OT_BOOL, 0, N_("migration with non-shared storage with incremental copy (same base image shared between source and destination)")}, - {"change-protection", VSH_OT_BOOL, 0, - N_("prevent any configuration changes to domain until migration ends)")}, - {"unsafe", VSH_OT_BOOL, 0, N_("force migration even if it may be unsafe")}, - {"verbose", VSH_OT_BOOL, 0, N_("display the progress of migration")}, - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"desturi", VSH_OT_DATA, VSH_OFLAG_REQ, N_("connection URI of the destination host as seen from the client(normal migration) or source(p2p migration)")}, - {"migrateuri", VSH_OT_DATA, 0, N_("migration URI, usually can be omitted")}, - {"dname", VSH_OT_DATA, 0, N_("rename to new name during migration (if supported)")}, - {"timeout", VSH_OT_INT, 0, N_("force guest to suspend if live migration exceeds timeout (in seconds)")}, - {"xml", VSH_OT_STRING, 0, N_("filename containing updated XML for the target")}, - {NULL, 0, 0, NULL} + {.name = "live", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("live migration") + }, + {.name = "offline", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("offline migration") + }, + {.name = "p2p", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("peer-2-peer migration") + }, + {.name = "direct", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("direct migration") + }, + {.name = "tunneled", + .type = VSH_OT_ALIAS, + .flags = 0, + .help = "tunnelled" + }, + {.name = "tunnelled", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("tunnelled migration") + }, + {.name = "persistent", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("persist VM on destination") + }, + {.name = "undefinesource", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("undefine VM on source") + }, + {.name = "suspend", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("do not restart the domain on the destination host") + }, + {.name = "copy-storage-all", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("migration with non-shared storage with full disk copy") + }, + {.name = "copy-storage-inc", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("migration with non-shared storage with incremental copy (same base image shared between source and destination)") + }, + {.name = "change-protection", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("prevent any configuration changes to domain until migration ends)") + }, + {.name = "unsafe", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("force migration even if it may be unsafe") + }, + {.name = "verbose", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("display the progress of migration") + }, + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "desturi", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("connection URI of the destination host as seen from the client(normal migration) or source(p2p migration)") + }, + {.name = "migrateuri", + .type = VSH_OT_DATA, + .flags = 0, + .help = N_("migration URI, usually can be omitted") + }, + {.name = "dname", + .type = VSH_OT_DATA, + .flags = 0, + .help = N_("rename to new name during migration (if supported)") + }, + {.name = "timeout", + .type = VSH_OT_INT, + .flags = 0, + .help = N_("force guest to suspend if live migration exceeds timeout (in seconds)") + }, + {.name = "xml", + .type = VSH_OT_STRING, + .flags = 0, + .help = N_("filename containing updated XML for the target") + }, + {.name = NULL} }; static void @@ -7232,9 +8393,17 @@ static const vshCmdInfo info_migrate_setmaxdowntime[] = { }; static const vshCmdOptDef opts_migrate_setmaxdowntime[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"downtime", VSH_OT_INT, VSH_OFLAG_REQ, N_("maximum tolerable downtime (in milliseconds) for migration")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "downtime", + .type = VSH_OT_INT, + .flags = VSH_OFLAG_REQ, + .help = N_("maximum tolerable downtime (in milliseconds) for migration") + }, + {.name = NULL} }; static bool @@ -7274,10 +8443,17 @@ static const vshCmdInfo info_migrate_setspeed[] = { }; static const vshCmdOptDef opts_migrate_setspeed[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"bandwidth", VSH_OT_INT, VSH_OFLAG_REQ, - N_("migration bandwidth limit in MiB/s")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "bandwidth", + .type = VSH_OT_INT, + .flags = VSH_OFLAG_REQ, + .help = N_("migration bandwidth limit in MiB/s") + }, + {.name = NULL} }; static bool @@ -7315,8 +8491,12 @@ static const vshCmdInfo info_migrate_getspeed[] = { }; static const vshCmdOptDef opts_migrate_getspeed[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = NULL} }; static bool @@ -7351,9 +8531,17 @@ static const vshCmdInfo info_domdisplay[] = { }; static const vshCmdOptDef opts_domdisplay[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"include-password", VSH_OT_BOOL, VSH_OFLAG_NONE, N_("includes the password into the connection URI if available")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "include-password", + .type = VSH_OT_BOOL, + .flags = VSH_OFLAG_NONE, + .help = N_("includes the password into the connection URI if available") + }, + {.name = NULL} }; static bool @@ -7522,8 +8710,12 @@ static const vshCmdInfo info_vncdisplay[] = { }; static const vshCmdOptDef opts_vncdisplay[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = NULL} }; static bool @@ -7587,8 +8779,12 @@ static const vshCmdInfo info_ttyconsole[] = { }; static const vshCmdOptDef opts_ttyconsole[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = NULL} }; static bool @@ -7639,8 +8835,12 @@ static const vshCmdInfo info_domhostname[] = { }; static const vshCmdOptDef opts_domhostname[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = NULL} }; static bool @@ -7925,11 +9125,27 @@ static const vshCmdInfo info_detach_device[] = { }; static const vshCmdOptDef opts_detach_device[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"file", VSH_OT_DATA, VSH_OFLAG_REQ, N_("XML file")}, - {"persistent", VSH_OT_ALIAS, 0, "config"}, - {"config", VSH_OT_BOOL, 0, N_("affect next boot")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "file", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("XML file") + }, + {.name = "persistent", + .type = VSH_OT_ALIAS, + .flags = 0, + .help = "config" + }, + {.name = "config", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("affect next boot") + }, + {.name = NULL} }; static bool @@ -7986,12 +9202,32 @@ static const vshCmdInfo info_update_device[] = { }; static const vshCmdOptDef opts_update_device[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"file", VSH_OT_DATA, VSH_OFLAG_REQ, N_("XML file")}, - {"persistent", VSH_OT_ALIAS, 0, "config"}, - {"config", VSH_OT_BOOL, 0, N_("affect next boot")}, - {"force", VSH_OT_BOOL, 0, N_("force device update")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "file", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("XML file") + }, + {.name = "persistent", + .type = VSH_OT_ALIAS, + .flags = 0, + .help = "config" + }, + {.name = "config", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("affect next boot") + }, + {.name = "force", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("force device update") + }, + {.name = NULL} }; static bool @@ -8053,12 +9289,32 @@ static const vshCmdInfo info_detach_interface[] = { }; static const vshCmdOptDef opts_detach_interface[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"type", VSH_OT_DATA, VSH_OFLAG_REQ, N_("network interface type")}, - {"mac", VSH_OT_STRING, 0, N_("MAC address")}, - {"persistent", VSH_OT_ALIAS, 0, "config"}, - {"config", VSH_OT_BOOL, 0, N_("affect next boot")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "type", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("network interface type") + }, + {.name = "mac", + .type = VSH_OT_STRING, + .flags = 0, + .help = N_("MAC address") + }, + {.name = "persistent", + .type = VSH_OT_ALIAS, + .flags = 0, + .help = "config" + }, + {.name = "config", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("affect next boot") + }, + {.name = NULL} }; static bool @@ -8414,11 +9670,27 @@ static const vshCmdInfo info_detach_disk[] = { }; static const vshCmdOptDef opts_detach_disk[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"target", VSH_OT_DATA, VSH_OFLAG_REQ, N_("target of disk device")}, - {"persistent", VSH_OT_ALIAS, 0, "config"}, - {"config", VSH_OT_BOOL, 0, N_("affect next boot")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "target", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("target of disk device") + }, + {.name = "persistent", + .type = VSH_OT_ALIAS, + .flags = 0, + .help = "config" + }, + {.name = "config", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("affect next boot") + }, + {.name = NULL} }; static bool @@ -8487,8 +9759,12 @@ static const vshCmdInfo info_edit[] = { }; static const vshCmdOptDef opts_edit[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = NULL} }; static bool @@ -8539,19 +9815,58 @@ static const vshCmdInfo info_change_media[] = { }; static const vshCmdOptDef opts_change_media[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"path", VSH_OT_DATA, VSH_OFLAG_REQ, N_("Fully-qualified path or " - "target of disk device")}, - {"source", VSH_OT_DATA, 0, N_("source of the media")}, - {"eject", VSH_OT_BOOL, 0, N_("Eject the media")}, - {"insert", VSH_OT_BOOL, 0, N_("Insert the media")}, - {"update", VSH_OT_BOOL, 0, N_("Update the media")}, - {"current", VSH_OT_BOOL, 0, N_("can be either or both of --live and --config, " - "depends on implementation of hypervisor driver")}, - {"live", VSH_OT_BOOL, 0, N_("alter live configuration of running domain")}, - {"config", VSH_OT_BOOL, 0, N_("alter persistent configuration, effect observed on next boot")}, - {"force", VSH_OT_BOOL, 0, N_("force media changing")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "path", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("Fully-qualified path or target of disk device") + }, + {.name = "source", + .type = VSH_OT_DATA, + .flags = 0, + .help = N_("source of the media") + }, + {.name = "eject", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("Eject the media") + }, + {.name = "insert", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("Insert the media") + }, + {.name = "update", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("Update the media") + }, + {.name = "current", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("can be either or both of --live and --config, " + "depends on implementation of hypervisor driver") + }, + {.name = "live", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("alter live configuration of running domain") + }, + {.name = "config", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("alter persistent configuration, effect observed on next boot") + }, + {.name = "force", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("force media changing") + }, + {.name = NULL} }; static bool @@ -8666,10 +9981,22 @@ static const vshCmdInfo info_domfstrim[] = { }; static const vshCmdOptDef opts_domfstrim[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"minimum", VSH_OT_INT, 0, N_("Just a hint to ignore contiguous " - "free ranges smaller than this (Bytes)")}, - {"mountpoint", VSH_OT_DATA, 0, N_("which mount point to trim")}, + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "minimum", + .type = VSH_OT_INT, + .flags = 0, + .help = N_("Just a hint to ignore contiguous " + "free ranges smaller than this (Bytes)") + }, + {.name = "mountpoint", + .type = VSH_OT_DATA, + .flags = 0, + .help = N_("which mount point to trim") + }, {NULL, 0, 0, NULL} }; static bool -- 1.8.0.2

On Mon, Jan 14, 2013 at 9:59 AM, Michal Privoznik <mprivozn@redhat.com> wrote:
--- tools/virsh-domain.c | 2299 +++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 1813 insertions(+), 486 deletions(-)
diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index e91939c..8165ea6 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -157,11 +157,27 @@ static const vshCmdInfo info_attach_device[] = { };
static const vshCmdOptDef opts_attach_device[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"file", VSH_OT_DATA, VSH_OFLAG_REQ, N_("XML file")}, - {"persistent", VSH_OT_ALIAS, 0, "config"}, - {"config", VSH_OT_BOOL, 0, N_("affect next boot")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "file", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("XML file") + }, + {.name = "persistent", + .type = VSH_OT_ALIAS, + .flags = 0, + .help = "config" + }, + {.name = "config", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("affect next boot") + }, + {.name = NULL} };
static bool @@ -219,25 +235,87 @@ static const vshCmdInfo info_attach_disk[] = { };
static const vshCmdOptDef opts_attach_disk[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"source", VSH_OT_DATA, VSH_OFLAG_REQ | VSH_OFLAG_EMPTY_OK, - N_("source of disk device")}, - {"target", VSH_OT_DATA, VSH_OFLAG_REQ, N_("target of disk device")}, - {"driver", VSH_OT_STRING, 0, N_("driver of disk device")}, - {"subdriver", VSH_OT_STRING, 0, N_("subdriver of disk device")}, - {"cache", VSH_OT_STRING, 0, N_("cache mode of disk device")}, - {"type", VSH_OT_STRING, 0, N_("target device type")}, - {"mode", VSH_OT_STRING, 0, N_("mode of device reading and writing")}, - {"persistent", VSH_OT_ALIAS, 0, "config"}, - {"config", VSH_OT_BOOL, 0, N_("affect next boot")}, - {"sourcetype", VSH_OT_STRING, 0, N_("type of source (block|file)")}, - {"serial", VSH_OT_STRING, 0, N_("serial of disk device")}, - {"shareable", VSH_OT_BOOL, 0, N_("shareable between domains")}, - {"rawio", VSH_OT_BOOL, 0, N_("needs rawio capability")}, - {"address", VSH_OT_STRING, 0, N_("address of disk device")}, - {"multifunction", VSH_OT_BOOL, 0, - N_("use multifunction pci under specified address")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "source", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ | VSH_OFLAG_EMPTY_OK, + .help = N_("source of disk device") + }, + {.name = "target", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("target of disk device") + }, + {.name = "driver", + .type = VSH_OT_STRING, + .flags = 0, + .help = N_("driver of disk device") + }, + {.name = "subdriver", + .type = VSH_OT_STRING, + .flags = 0, + .help = N_("subdriver of disk device") + }, + {.name = "cache", + .type = VSH_OT_STRING, + .flags = 0, + .help = N_("cache mode of disk device") + }, + {.name = "type", + .type = VSH_OT_STRING, + .flags = 0, + .help = N_("target device type") + }, + {.name = "mode", + .type = VSH_OT_STRING, + .flags = 0, + .help = N_("mode of device reading and writing") + }, + {.name = "persistent", + .type = VSH_OT_ALIAS, + .flags = 0, + .help = "config" + }, + {.name = "config", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("affect next boot") + }, + {.name = "sourcetype", + .type = VSH_OT_STRING, + .flags = 0, + .help = N_("type of source (block|file)") + }, + {.name = "serial", + .type = VSH_OT_STRING, + .flags = 0, + .help = N_("serial of disk device") + }, + {.name = "shareable", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("shareable between domains") + }, + {.name = "rawio", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("needs rawio capability") + }, + {.name = "address", + .type = VSH_OT_STRING, + .flags = 0, + .help = N_("address of disk device") + }, + {.name = "multifunction", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("use multifunction pci under specified address") + }, + {.name = NULL} };
enum { @@ -575,18 +653,62 @@ static const vshCmdInfo info_attach_interface[] = { };
static const vshCmdOptDef opts_attach_interface[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"type", VSH_OT_DATA, VSH_OFLAG_REQ, N_("network interface type")}, - {"source", VSH_OT_DATA, VSH_OFLAG_REQ, N_("source of network interface")}, - {"target", VSH_OT_DATA, 0, N_("target network name")}, - {"mac", VSH_OT_DATA, 0, N_("MAC address")}, - {"script", VSH_OT_DATA, 0, N_("script used to bridge network interface")}, - {"model", VSH_OT_DATA, 0, N_("model type")}, - {"persistent", VSH_OT_ALIAS, 0, "config"}, - {"config", VSH_OT_BOOL, 0, N_("affect next boot")}, - {"inbound", VSH_OT_DATA, VSH_OFLAG_NONE, N_("control domain's incoming traffics")}, - {"outbound", VSH_OT_DATA, VSH_OFLAG_NONE, N_("control domain's outgoing traffics")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "type", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("network interface type") + }, + {.name = "source", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("source of network interface") + }, + {.name = "target", + .type = VSH_OT_DATA, + .flags = 0, + .help = N_("target network name") + }, + {.name = "mac", + .type = VSH_OT_DATA, + .flags = 0, + .help = N_("MAC address") + }, + {.name = "script", + .type = VSH_OT_DATA, + .flags = 0, + .help = N_("script used to bridge network interface") + }, + {.name = "model", + .type = VSH_OT_DATA, + .flags = 0, + .help = N_("model type") + }, + {.name = "persistent", + .type = VSH_OT_ALIAS, + .flags = 0, + .help = "config" + }, + {.name = "config", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("affect next boot") + }, + {.name = "inbound", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_NONE, + .help = N_("control domain's incoming traffics") + }, + {.name = "outbound", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_NONE, + .help = N_("control domain's outgoing traffics") + }, + {.name = NULL} };
/* parse inbound and outbound which are in the format of @@ -773,9 +895,17 @@ static const vshCmdInfo info_autostart[] = { };
static const vshCmdOptDef opts_autostart[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"disable", VSH_OT_BOOL, 0, N_("disable autostarting")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "disable", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("disable autostarting") + }, + {.name = NULL} };
static bool @@ -818,30 +948,92 @@ static const vshCmdInfo info_blkdeviotune[] = { };
static const vshCmdOptDef opts_blkdeviotune[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"device", VSH_OT_DATA, VSH_OFLAG_REQ, N_("block device")}, - {"total_bytes_sec", VSH_OT_ALIAS, 0, "total-bytes-sec"}, - {"total-bytes-sec", VSH_OT_INT, VSH_OFLAG_NONE, - N_("total throughput limit in bytes per second")}, - {"read_bytes_sec", VSH_OT_ALIAS, 0, "read-bytes-sec"}, - {"read-bytes-sec", VSH_OT_INT, VSH_OFLAG_NONE, - N_("read throughput limit in bytes per second")}, - {"write_bytes_sec", VSH_OT_ALIAS, 0, "write-bytes-sec"}, - {"write-bytes-sec", VSH_OT_INT, VSH_OFLAG_NONE, - N_("write throughput limit in bytes per second")}, - {"total_iops_sec", VSH_OT_ALIAS, 0, "total-iops-sec"}, - {"total-iops-sec", VSH_OT_INT, VSH_OFLAG_NONE, - N_("total I/O operations limit per second")}, - {"read_iops_sec", VSH_OT_ALIAS, 0, "read-iops-sec"}, - {"read-iops-sec", VSH_OT_INT, VSH_OFLAG_NONE, - N_("read I/O operations limit per second")}, - {"write_iops_sec", VSH_OT_ALIAS, 0, "write-iops-sec"}, - {"write-iops-sec", VSH_OT_INT, VSH_OFLAG_NONE, - N_("write I/O operations limit per second")}, - {"config", VSH_OT_BOOL, 0, N_("affect next boot")}, - {"live", VSH_OT_BOOL, 0, N_("affect running domain")}, - {"current", VSH_OT_BOOL, 0, N_("affect current domain")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "device", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("block device") + }, + {.name = "total_bytes_sec", + .type = VSH_OT_ALIAS, + .flags = 0, + .help = "total-bytes-sec" + }, + {.name = "total-bytes-sec", + .type = VSH_OT_INT, + .flags = VSH_OFLAG_NONE, + .help = N_("total throughput limit in bytes per second") + }, + {.name = "read_bytes_sec", + .type = VSH_OT_ALIAS, + .flags = 0, + .help = "read-bytes-sec" + }, + {.name = "read-bytes-sec", + .type = VSH_OT_INT, + .flags = VSH_OFLAG_NONE, + .help = N_("read throughput limit in bytes per second") + }, + {.name = "write_bytes_sec", + .type = VSH_OT_ALIAS, + .flags = 0, + .help = "write-bytes-sec" + }, + {.name = "write-bytes-sec", + .type = VSH_OT_INT, + .flags = VSH_OFLAG_NONE, + .help = N_("write throughput limit in bytes per second") + }, + {.name = "total_iops_sec", + .type = VSH_OT_ALIAS, + .flags = 0, + .help = "total-iops-sec" + }, + {.name = "total-iops-sec", + .type = VSH_OT_INT, + .flags = VSH_OFLAG_NONE, + .help = N_("total I/O operations limit per second") + }, + {.name = "read_iops_sec", + .type = VSH_OT_ALIAS, + .flags = 0, + .help = "read-iops-sec" + }, + {.name = "read-iops-sec", + .type = VSH_OT_INT, + .flags = VSH_OFLAG_NONE, + .help = N_("read I/O operations limit per second") + }, + {.name = "write_iops_sec", + .type = VSH_OT_ALIAS, + .flags = 0, + .help = "write-iops-sec" + }, + {.name = "write-iops-sec", + .type = VSH_OT_INT, + .flags = VSH_OFLAG_NONE, + .help = N_("write I/O operations limit per second") + }, + {.name = "config", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("affect next boot") + }, + {.name = "live", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("affect running domain") + }, + {.name = "current", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("affect current domain") + }, + {.name = NULL} };
static bool @@ -1038,15 +1230,37 @@ static const vshCmdInfo info_blkiotune[] = { };
static const vshCmdOptDef opts_blkiotune[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"weight", VSH_OT_INT, VSH_OFLAG_NONE, - N_("IO Weight in range [100, 1000]")}, - {"device-weights", VSH_OT_STRING, VSH_OFLAG_NONE, - N_("per-device IO Weights, in the form of /path/to/device,weight,...")}, - {"config", VSH_OT_BOOL, 0, N_("affect next boot")}, - {"live", VSH_OT_BOOL, 0, N_("affect running domain")}, - {"current", VSH_OT_BOOL, 0, N_("affect current domain")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "weight", + .type = VSH_OT_INT, + .flags = VSH_OFLAG_NONE, + .help = N_("IO Weight in range [100, 1000]") + }, + {.name = "device-weights", + .type = VSH_OT_STRING, + .flags = VSH_OFLAG_NONE, + .help = N_("per-device IO Weights, in the form of /path/to/device,weight,...") + }, + {.name = "config", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("affect next boot") + }, + {.name = "live", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("affect running domain") + }, + {.name = "current", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("affect current domain") + }, + {.name = NULL} };
static bool @@ -1303,21 +1517,57 @@ static const vshCmdInfo info_block_commit[] = { };
static const vshCmdOptDef opts_block_commit[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"path", VSH_OT_DATA, VSH_OFLAG_REQ, N_("fully-qualified path of disk")}, - {"bandwidth", VSH_OT_DATA, VSH_OFLAG_NONE, N_("bandwidth limit in MiB/s")}, - {"base", VSH_OT_DATA, VSH_OFLAG_NONE, - N_("path of base file to commit into (default bottom of chain)")}, - {"shallow", VSH_OT_BOOL, 0, N_("use backing file of top as base")}, - {"top", VSH_OT_DATA, VSH_OFLAG_NONE, - N_("path of top file to commit from (default top of chain)")}, - {"delete", VSH_OT_BOOL, 0, - N_("delete files that were successfully committed")}, - {"wait", VSH_OT_BOOL, 0, N_("wait for job to complete")}, - {"verbose", VSH_OT_BOOL, 0, N_("with --wait, display the progress")}, - {"timeout", VSH_OT_INT, VSH_OFLAG_NONE, - N_("with --wait, abort if copy exceeds timeout (in seconds)")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "path", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("fully-qualified path of disk") + }, + {.name = "bandwidth", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_NONE, + .help = N_("bandwidth limit in MiB/s") + }, + {.name = "base", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_NONE, + .help = N_("path of base file to commit into (default bottom of chain)") + }, + {.name = "shallow", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("use backing file of top as base") + }, + {.name = "top", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_NONE, + .help = N_("path of top file to commit from (default top of chain)") + }, + {.name = "delete", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("delete files that were successfully committed") + }, + {.name = "wait", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("wait for job to complete") + }, + {.name = "verbose", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("with --wait, display the progress") + }, + {.name = "timeout", + .type = VSH_OT_INT, + .flags = VSH_OFLAG_NONE, + .help = N_("with --wait, abort if copy exceeds timeout (in seconds)") + }, + {.name = NULL} };
static bool @@ -1446,22 +1696,72 @@ static const vshCmdInfo info_block_copy[] = { };
static const vshCmdOptDef opts_block_copy[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"path", VSH_OT_DATA, VSH_OFLAG_REQ, N_("fully-qualified path of disk")}, - {"dest", VSH_OT_DATA, VSH_OFLAG_REQ, N_("path of the copy to create")}, - {"bandwidth", VSH_OT_DATA, VSH_OFLAG_NONE, N_("bandwidth limit in MiB/s")}, - {"shallow", VSH_OT_BOOL, 0, N_("make the copy share a backing chain")}, - {"reuse-external", VSH_OT_BOOL, 0, N_("reuse existing destination")}, - {"raw", VSH_OT_BOOL, 0, N_("use raw destination file")}, - {"wait", VSH_OT_BOOL, 0, N_("wait for job to reach mirroring phase")}, - {"verbose", VSH_OT_BOOL, 0, N_("with --wait, display the progress")}, - {"timeout", VSH_OT_INT, VSH_OFLAG_NONE, - N_("with --wait, abort if copy exceeds timeout (in seconds)")}, - {"pivot", VSH_OT_BOOL, 0, N_("with --wait, pivot when mirroring starts")}, - {"finish", VSH_OT_BOOL, 0, N_("with --wait, quit when mirroring starts")}, - {"async", VSH_OT_BOOL, 0, - N_("with --wait, don't wait for cancel to finish")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "path", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("fully-qualified path of disk") + }, + {.name = "dest", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("path of the copy to create") + }, + {.name = "bandwidth", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_NONE, + .help = N_("bandwidth limit in MiB/s") + }, + {.name = "shallow", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("make the copy share a backing chain") + }, + {.name = "reuse-external", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("reuse existing destination") + }, + {.name = "raw", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("use raw destination file") + }, + {.name = "wait", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("wait for job to reach mirroring phase") + }, + {.name = "verbose", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("with --wait, display the progress") + }, + {.name = "timeout", + .type = VSH_OT_INT, + .flags = VSH_OFLAG_NONE, + .help = N_("with --wait, abort if copy exceeds timeout (in seconds)") + }, + {.name = "pivot", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("with --wait, pivot when mirroring starts") + }, + {.name = "finish", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("with --wait, quit when mirroring starts") + }, + {.name = "async", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("with --wait, don't wait for cancel to finish") + }, + {.name = NULL} };
static bool @@ -1604,19 +1904,42 @@ static const vshCmdInfo info_block_job[] = { };
static const vshCmdOptDef opts_block_job[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"path", VSH_OT_DATA, VSH_OFLAG_REQ, N_("fully-qualified path of disk")}, - {"abort", VSH_OT_BOOL, VSH_OFLAG_NONE, - N_("abort the active job on the specified disk")}, - {"async", VSH_OT_BOOL, VSH_OFLAG_NONE, - N_("don't wait for --abort to complete")}, - {"pivot", VSH_OT_BOOL, VSH_OFLAG_NONE, - N_("conclude and pivot a copy job")}, - {"info", VSH_OT_BOOL, VSH_OFLAG_NONE, - N_("get active job information for the specified disk")}, - {"bandwidth", VSH_OT_DATA, VSH_OFLAG_NONE, - N_("set the Bandwidth limit in MiB/s")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "path", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("fully-qualified path of disk") + }, + {.name = "abort", + .type = VSH_OT_BOOL, + .flags = VSH_OFLAG_NONE, + .help = N_("abort the active job on the specified disk") + }, + {.name = "async", + .type = VSH_OT_BOOL, + .flags = VSH_OFLAG_NONE, + .help = N_("don't wait for --abort to complete") + }, + {.name = "pivot", + .type = VSH_OT_BOOL, + .flags = VSH_OFLAG_NONE, + .help = N_("conclude and pivot a copy job") + }, + {.name = "info", + .type = VSH_OT_BOOL, + .flags = VSH_OFLAG_NONE, + .help = N_("get active job information for the specified disk") + }, + {.name = "bandwidth", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_NONE, + .help = N_("set the Bandwidth limit in MiB/s") + }, + {.name = NULL} };
static bool @@ -1680,18 +2003,47 @@ static const vshCmdInfo info_block_pull[] = { };
static const vshCmdOptDef opts_block_pull[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"path", VSH_OT_DATA, VSH_OFLAG_REQ, N_("fully-qualified path of disk")}, - {"bandwidth", VSH_OT_DATA, VSH_OFLAG_NONE, N_("bandwidth limit in MiB/s")}, - {"base", VSH_OT_DATA, VSH_OFLAG_NONE, - N_("path of backing file in chain for a partial pull")}, - {"wait", VSH_OT_BOOL, 0, N_("wait for job to finish")}, - {"verbose", VSH_OT_BOOL, 0, N_("with --wait, display the progress")}, - {"timeout", VSH_OT_INT, VSH_OFLAG_NONE, - N_("with --wait, abort if pull exceeds timeout (in seconds)")}, - {"async", VSH_OT_BOOL, 0, - N_("with --wait, don't wait for cancel to finish")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "path", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("fully-qualified path of disk") + }, + {.name = "bandwidth", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_NONE, + .help = N_("bandwidth limit in MiB/s") + }, + {.name = "base", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_NONE, + .help = N_("path of backing file in chain for a partial pull") + }, + {.name = "wait", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("wait for job to finish") + }, + {.name = "verbose", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("with --wait, display the progress") + }, + {.name = "timeout", + .type = VSH_OT_INT, + .flags = VSH_OFLAG_NONE, + .help = N_("with --wait, abort if pull exceeds timeout (in seconds)") + }, + {.name = "async", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("with --wait, don't wait for cancel to finish") + }, + {.name = NULL} };
static bool @@ -1819,12 +2171,22 @@ static const vshCmdInfo info_block_resize[] = { };
static const vshCmdOptDef opts_block_resize[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"path", VSH_OT_DATA, VSH_OFLAG_REQ, - N_("Fully-qualified path of block device")}, - {"size", VSH_OT_INT, VSH_OFLAG_REQ, - N_("New size of the block device, as scaled integer (default KiB)")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "path", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("Fully-qualified path of block device") + }, + {.name = "size", + .type = VSH_OT_INT, + .flags = VSH_OFLAG_REQ, + .help = N_("New size of the block device, as scaled integer (default KiB)") + }, + {.name = NULL} };
static bool @@ -1878,13 +2240,27 @@ static const vshCmdInfo info_console[] = { };
static const vshCmdOptDef opts_console[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"devname", VSH_OT_STRING, 0, N_("character device name")}, - {"force", VSH_OT_BOOL, 0, - N_("force console connection (disconnect already connected sessions)")}, - {"safe", VSH_OT_BOOL, 0, - N_("only connect if safe console handling is supported")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "devname", + .type = VSH_OT_STRING, + .flags = 0, + .help = N_("character device name") + }, + {.name = "force", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("force console connection (disconnect already connected sessions)") + }, + {.name = "safe", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("only connect if safe console handling is supported") + }, + {.name = NULL} };
static bool @@ -1961,12 +2337,32 @@ static const vshCmdInfo info_domif_setlink[] = { };
static const vshCmdOptDef opts_domif_setlink[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"interface", VSH_OT_DATA, VSH_OFLAG_REQ, N_("interface device (MAC Address)")}, - {"state", VSH_OT_DATA, VSH_OFLAG_REQ, N_("new state of the device")}, - {"persistent", VSH_OT_ALIAS, 0, "config"}, - {"config", VSH_OT_BOOL, 0, N_("affect next boot")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "interface", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("interface device (MAC Address)") + }, + {.name = "state", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("new state of the device") + }, + {.name = "persistent", + .type = VSH_OT_ALIAS, + .flags = 0, + .help = "config" + }, + {.name = "config", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("affect next boot") + }, + {.name = NULL} };
static bool @@ -2135,14 +2531,42 @@ static const vshCmdInfo info_domiftune[] = { };
static const vshCmdOptDef opts_domiftune[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"interface", VSH_OT_DATA, VSH_OFLAG_REQ, N_("interface device (MAC Address)")}, - {"inbound", VSH_OT_DATA, VSH_OFLAG_NONE, N_("control domain's incoming traffics")}, - {"outbound", VSH_OT_DATA, VSH_OFLAG_NONE, N_("control domain's outgoing traffics")}, - {"config", VSH_OT_BOOL, VSH_OFLAG_NONE, N_("affect next boot")}, - {"live", VSH_OT_BOOL, VSH_OFLAG_NONE, N_("affect running domain")}, - {"current", VSH_OT_BOOL, VSH_OFLAG_NONE, N_("affect current domain")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "interface", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("interface device (MAC Address)") + }, + {.name = "inbound", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_NONE, + .help = N_("control domain's incoming traffics") + }, + {.name = "outbound", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_NONE, + .help = N_("control domain's outgoing traffics") + }, + {.name = "config", + .type = VSH_OT_BOOL, + .flags = VSH_OFLAG_NONE, + .help = N_("affect next boot") + }, + {.name = "live", + .type = VSH_OT_BOOL, + .flags = VSH_OFLAG_NONE, + .help = N_("affect running domain") + }, + {.name = "current", + .type = VSH_OT_BOOL, + .flags = VSH_OFLAG_NONE, + .help = N_("affect current domain") + }, + {.name = NULL} };
static bool @@ -2328,8 +2752,12 @@ static const vshCmdInfo info_suspend[] = { };
static const vshCmdOptDef opts_suspend[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = NULL} };
static bool @@ -2366,12 +2794,24 @@ static const vshCmdInfo info_dom_pm_suspend[] = { };
static const vshCmdOptDef opts_dom_pm_suspend[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"duration", VSH_OT_INT, VSH_OFLAG_REQ_OPT, N_("duration in seconds")}, - {"target", VSH_OT_STRING, VSH_OFLAG_REQ, N_("mem(Suspend-to-RAM), " - "disk(Suspend-to-Disk), " - "hybrid(Hybrid-Suspend)")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "duration", + .type = VSH_OT_INT, + .flags = VSH_OFLAG_REQ_OPT, + .help = N_("duration in seconds") + }, + {.name = "target", + .type = VSH_OT_STRING, + .flags = VSH_OFLAG_REQ, + .help = N_("mem(Suspend-to-RAM), " + "disk(Suspend-to-Disk), " + "hybrid(Hybrid-Suspend)") + }, + {.name = NULL} };
static bool @@ -2436,8 +2876,12 @@ static const vshCmdInfo info_dom_pm_wakeup[] = { };
static const vshCmdOptDef opts_dom_pm_wakeup[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = NULL} };
static bool @@ -2478,18 +2922,38 @@ static const vshCmdInfo info_undefine[] = { };
static const vshCmdOptDef opts_undefine[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name or uuid")}, - {"managed-save", VSH_OT_BOOL, 0, N_("remove domain managed state file")}, - {"storage", VSH_OT_DATA, VSH_OFLAG_NONE, - N_("remove associated storage volumes (comma separated list of targets " - "or source paths) (see domblklist)")}, - {"remove-all-storage", VSH_OT_BOOL, 0, - N_("remove all associated storage volumes (use with caution)")}, - {"wipe-storage", VSH_OT_BOOL, VSH_OFLAG_NONE, - N_("wipe data on the removed volumes")}, - {"snapshots-metadata", VSH_OT_BOOL, 0, - N_("remove all domain snapshot metadata, if inactive")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name or uuid") + }, + {.name = "managed-save", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("remove domain managed state file") + }, + {.name = "storage", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_NONE, + .help = N_("remove associated storage volumes (comma separated list of " + "targets or source paths) (see domblklist)") + }, + {.name = "remove-all-storage", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("remove all associated storage volumes (use with caution)") + }, + {.name = "wipe-storage", + .type = VSH_OT_BOOL, + .flags = VSH_OFLAG_NONE, + .help = N_("wipe data on the removed volumes") + }, + {.name = "snapshots-metadata", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("remove all domain snapshot metadata, if inactive") + }, + {.name = NULL} };
typedef struct { @@ -2818,18 +3282,39 @@ static const vshCmdInfo info_start[] = { };
static const vshCmdOptDef opts_start[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("name of the inactive domain")}, + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("name of the inactive domain") + }, #ifndef WIN32 - {"console", VSH_OT_BOOL, 0, N_("attach to console after creation")}, + {.name = "console", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("attach to console after creation") + }, #endif - {"paused", VSH_OT_BOOL, 0, N_("leave the guest paused after creation")}, - {"autodestroy", VSH_OT_BOOL, 0, - N_("automatically destroy the guest when virsh disconnects")}, - {"bypass-cache", VSH_OT_BOOL, 0, - N_("avoid file system cache when loading")}, - {"force-boot", VSH_OT_BOOL, 0, - N_("force fresh boot by discarding any managed save")}, - {NULL, 0, 0, NULL} + {.name = "paused", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("leave the guest paused after creation") + }, + {.name = "autodestroy", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("automatically destroy the guest when virsh disconnects") + }, + {.name = "bypass-cache", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("avoid file system cache when loading") + }, + {.name = "force-boot", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("force fresh boot by discarding any managed save") + }, + {.name = NULL} };
static bool @@ -2917,15 +3402,42 @@ static const vshCmdInfo info_save[] = { };
static const vshCmdOptDef opts_save[] = { - {"bypass-cache", VSH_OT_BOOL, 0, N_("avoid file system cache when saving")}, - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"file", VSH_OT_DATA, VSH_OFLAG_REQ, N_("where to save the data")}, - {"xml", VSH_OT_STRING, 0, - N_("filename containing updated XML for the target")}, - {"running", VSH_OT_BOOL, 0, N_("set domain to be running on restore")}, - {"paused", VSH_OT_BOOL, 0, N_("set domain to be paused on restore")}, - {"verbose", VSH_OT_BOOL, 0, N_("display the progress of save")}, - {NULL, 0, 0, NULL} + {.name = "bypass-cache", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("avoid file system cache when saving") + }, + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "file", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("where to save the data") + }, + {.name = "xml", + .type = VSH_OT_STRING, + .flags = 0, + .help = N_("filename containing updated XML for the target") + }, + {.name = "running", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("set domain to be running on restore") + }, + {.name = "paused", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("set domain to be paused on restore") + }, + {.name = "verbose", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("display the progress of save") + }, + {.name = NULL} };
static void @@ -3140,9 +3652,17 @@ static const vshCmdInfo info_save_image_dumpxml[] = { };
static const vshCmdOptDef opts_save_image_dumpxml[] = { - {"file", VSH_OT_DATA, VSH_OFLAG_REQ, N_("saved state file to read")}, - {"security-info", VSH_OT_BOOL, 0, N_("include security sensitive information in XML dump")}, - {NULL, 0, 0, NULL} + {.name = "file", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("saved state file to read") + }, + {.name = "security-info", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("include security sensitive information in XML dump") + }, + {.name = NULL} };
static bool @@ -3181,12 +3701,27 @@ static const vshCmdInfo info_save_image_define[] = { };
static const vshCmdOptDef opts_save_image_define[] = { - {"file", VSH_OT_DATA, VSH_OFLAG_REQ, N_("saved state file to modify")}, - {"xml", VSH_OT_STRING, VSH_OFLAG_REQ, - N_("filename containing updated XML for the target")}, - {"running", VSH_OT_BOOL, 0, N_("set domain to be running on restore")}, - {"paused", VSH_OT_BOOL, 0, N_("set domain to be paused on restore")}, - {NULL, 0, 0, NULL} + {.name = "file", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("saved state file to modify") + }, + {.name = "xml", + .type = VSH_OT_STRING, + .flags = VSH_OFLAG_REQ, + .help = N_("filename containing updated XML for the target") + }, + {.name = "running", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("set domain to be running on restore") + }, + {.name = "paused", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("set domain to be paused on restore") + }, + {.name = NULL} };
static bool @@ -3237,10 +3772,22 @@ static const vshCmdInfo info_save_image_edit[] = { };
static const vshCmdOptDef opts_save_image_edit[] = { - {"file", VSH_OT_DATA, VSH_OFLAG_REQ, N_("saved state file to edit")}, - {"running", VSH_OT_BOOL, 0, N_("set domain to be running on restore")}, - {"paused", VSH_OT_BOOL, 0, N_("set domain to be paused on restore")}, - {NULL, 0, 0, NULL} + {.name = "file", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("saved state file to edit") + }, + {.name = "running", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("set domain to be running on restore") + }, + {.name = "paused", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("set domain to be paused on restore") + }, + {.name = NULL} };
static bool @@ -3299,12 +3846,32 @@ static const vshCmdInfo info_managedsave[] = { };
static const vshCmdOptDef opts_managedsave[] = { - {"bypass-cache", VSH_OT_BOOL, 0, N_("avoid file system cache when saving")}, - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"running", VSH_OT_BOOL, 0, N_("set domain to be running on next start")}, - {"paused", VSH_OT_BOOL, 0, N_("set domain to be paused on next start")}, - {"verbose", VSH_OT_BOOL, 0, N_("display the progress of save")}, - {NULL, 0, 0, NULL} + {.name = "bypass-cache", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("avoid file system cache when saving") + }, + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "running", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("set domain to be running on next start") + }, + {.name = "paused", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("set domain to be paused on next start") + }, + {.name = "verbose", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("display the progress of save") + }, + {.name = NULL} };
static void @@ -3403,8 +3970,12 @@ static const vshCmdInfo info_managedsaveremove[] = { };
static const vshCmdOptDef opts_managedsaveremove[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = NULL} };
static bool @@ -3454,14 +4025,42 @@ static const vshCmdInfo info_schedinfo[] = { };
static const vshCmdOptDef opts_schedinfo[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"set", VSH_OT_STRING, VSH_OFLAG_NONE, N_("parameter=value")}, - {"weight", VSH_OT_INT, VSH_OFLAG_NONE, N_("weight for XEN_CREDIT")}, - {"cap", VSH_OT_INT, VSH_OFLAG_NONE, N_("cap for XEN_CREDIT")}, - {"current", VSH_OT_BOOL, 0, N_("get/set current scheduler info")}, - {"config", VSH_OT_BOOL, 0, N_("get/set value to be used on next boot")}, - {"live", VSH_OT_BOOL, 0, N_("get/set value from running domain")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "set", + .type = VSH_OT_STRING, + .flags = VSH_OFLAG_NONE, + .help = N_("parameter=value") + }, + {.name = "weight", + .type = VSH_OT_INT, + .flags = VSH_OFLAG_NONE, + .help = N_("weight for XEN_CREDIT") + }, + {.name = "cap", + .type = VSH_OT_INT, + .flags = VSH_OFLAG_NONE, + .help = N_("cap for XEN_CREDIT") + }, + {.name = "current", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("get/set current scheduler info") + }, + {.name = "config", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("get/set value to be used on next boot") + }, + {.name = "live", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("get/set value from running domain") + }, + {.name = NULL} };
static int @@ -3675,14 +4274,32 @@ static const vshCmdInfo info_restore[] = { };
static const vshCmdOptDef opts_restore[] = { - {"file", VSH_OT_DATA, VSH_OFLAG_REQ, N_("the state to restore")}, - {"bypass-cache", VSH_OT_BOOL, 0, - N_("avoid file system cache when restoring")}, - {"xml", VSH_OT_STRING, 0, - N_("filename containing updated XML for the target")}, - {"running", VSH_OT_BOOL, 0, N_("restore domain into running state")}, - {"paused", VSH_OT_BOOL, 0, N_("restore domain into paused state")}, - {NULL, 0, 0, NULL} + {.name = "file", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("the state to restore") + }, + {.name = "bypass-cache", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("avoid file system cache when restoring") + }, + {.name = "xml", + .type = VSH_OT_STRING, + .flags = 0, + .help = N_("filename containing updated XML for the target") + }, + {.name = "running", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("restore domain into running state") + }, + {.name = "paused", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("restore domain into paused state") + }, + {.name = NULL} };
static bool @@ -3738,16 +4355,47 @@ static const vshCmdInfo info_dump[] = { };
static const vshCmdOptDef opts_dump[] = { - {"live", VSH_OT_BOOL, 0, N_("perform a live core dump if supported")}, - {"crash", VSH_OT_BOOL, 0, N_("crash the domain after core dump")}, - {"bypass-cache", VSH_OT_BOOL, 0, - N_("avoid file system cache when saving")}, - {"reset", VSH_OT_BOOL, 0, N_("reset the domain after core dump")}, - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"file", VSH_OT_DATA, VSH_OFLAG_REQ, N_("where to dump the core")}, - {"verbose", VSH_OT_BOOL, 0, N_("display the progress of dump")}, - {"memory-only", VSH_OT_BOOL, 0, N_("dump domain's memory only")}, - {NULL, 0, 0, NULL} + {.name = "live", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("perform a live core dump if supported") + }, + {.name = "crash", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("crash the domain after core dump") + }, + {.name = "bypass-cache", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("avoid file system cache when saving") + }, + {.name = "reset", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("reset the domain after core dump") + }, + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "file", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("where to dump the core") + }, + {.name = "verbose", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("display the progress of dump") + }, + {.name = "memory-only", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("dump domain's memory only") + }, + {.name = NULL} };
static void @@ -3855,10 +4503,22 @@ static const vshCmdInfo info_screenshot[] = { };
static const vshCmdOptDef opts_screenshot[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"file", VSH_OT_DATA, VSH_OFLAG_NONE, N_("where to store the screenshot")}, - {"screen", VSH_OT_INT, VSH_OFLAG_NONE, N_("ID of a screen to take screenshot of")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "file", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_NONE, + .help = N_("where to store the screenshot") + }, + {.name = "screen", + .type = VSH_OT_INT, + .flags = VSH_OFLAG_NONE, + .help = N_("ID of a screen to take screenshot of") + }, + {.name = NULL} };
/** @@ -3990,8 +4650,12 @@ static const vshCmdInfo info_resume[] = { };
static const vshCmdOptDef opts_resume[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = NULL} };
static bool @@ -4025,9 +4689,17 @@ static const vshCmdInfo info_shutdown[] = { };
static const vshCmdOptDef opts_shutdown[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"mode", VSH_OT_STRING, VSH_OFLAG_NONE, N_("shutdown mode: acpi|agent")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "mode", + .type = VSH_OT_STRING, + .flags = VSH_OFLAG_NONE, + .help = N_("shutdown mode: acpi|agent") + }, + {.name = NULL} };
static bool @@ -4102,9 +4774,17 @@ static const vshCmdInfo info_reboot[] = { };
static const vshCmdOptDef opts_reboot[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"mode", VSH_OT_STRING, VSH_OFLAG_NONE, N_("shutdown mode: acpi|agent")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "mode", + .type = VSH_OT_STRING, + .flags = VSH_OFLAG_NONE, + .help = N_("shutdown mode: acpi|agent") + }, + {.name = NULL} };
static bool @@ -4174,8 +4854,12 @@ static const vshCmdInfo info_reset[] = { };
static const vshCmdOptDef opts_reset[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = NULL} };
static bool @@ -4209,8 +4893,12 @@ static const vshCmdInfo info_domjobinfo[] = { };
static const vshCmdOptDef opts_domjobinfo[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = NULL} };
static bool @@ -4288,8 +4976,12 @@ static const vshCmdInfo info_domjobabort[] = { };
static const vshCmdOptDef opts_domjobabort[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = NULL} };
static bool @@ -4318,8 +5010,12 @@ static const vshCmdInfo info_maxvcpus[] = { };
static const vshCmdOptDef opts_maxvcpus[] = { - {"type", VSH_OT_STRING, 0, N_("domain type")}, - {NULL, 0, 0, NULL} + {.name = "type", + .type = VSH_OT_STRING, + .flags = 0, + .help = N_("domain type") + }, + {.name = NULL} };
static bool @@ -4351,14 +5047,37 @@ static const vshCmdInfo info_vcpucount[] = { };
static const vshCmdOptDef opts_vcpucount[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"maximum", VSH_OT_BOOL, 0, N_("get maximum cap on vcpus")}, - {"active", VSH_OT_BOOL, 0, N_("get number of currently active vcpus")}, - {"live", VSH_OT_BOOL, 0, N_("get value from running domain")}, - {"config", VSH_OT_BOOL, 0, N_("get value to be used on next boot")}, - {"current", VSH_OT_BOOL, 0, - N_("get value according to current domain state")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "maximum", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("get maximum cap on vcpus") + }, + {.name = "active", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("get number of currently active vcpus") + }, + {.name = "live", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("get value from running domain") + }, + {.name = "config", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("get value to be used on next boot") + }, + {.name = "current", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("get value according to current domain state") + }, + {.name = NULL} };
static bool @@ -4551,8 +5270,12 @@ static const vshCmdInfo info_vcpuinfo[] = { };
static const vshCmdOptDef opts_vcpuinfo[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = NULL} };
static bool @@ -4652,14 +5375,37 @@ static const vshCmdInfo info_vcpupin[] = { };
static const vshCmdOptDef opts_vcpupin[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"vcpu", VSH_OT_INT, 0, N_("vcpu number")}, - {"cpulist", VSH_OT_DATA, VSH_OFLAG_EMPTY_OK, - N_("host cpu number(s) to set, or omit option to query")}, - {"config", VSH_OT_BOOL, 0, N_("affect next boot")}, - {"live", VSH_OT_BOOL, 0, N_("affect running domain")}, - {"current", VSH_OT_BOOL, 0, N_("affect current domain")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "vcpu", + .type = VSH_OT_INT, + .flags = 0, + .help = N_("vcpu number") + }, + {.name = "cpulist", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_EMPTY_OK, + .help = N_("host cpu number(s) to set, or omit option to query") + }, + {.name = "config", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("affect next boot") + }, + {.name = "live", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("affect running domain") + }, + {.name = "current", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("affect current domain") + }, + {.name = NULL} };
/* @@ -4910,13 +5656,32 @@ static const vshCmdInfo info_emulatorpin[] = { };
static const vshCmdOptDef opts_emulatorpin[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"cpulist", VSH_OT_DATA, VSH_OFLAG_EMPTY_OK, - N_("host cpu number(s) to set, or omit option to query")}, - {"config", VSH_OT_BOOL, 0, N_("affect next boot")}, - {"live", VSH_OT_BOOL, 0, N_("affect running domain")}, - {"current", VSH_OT_BOOL, 0, N_("affect current domain")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "cpulist", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_EMPTY_OK, + .help = N_("host cpu number(s) to set, or omit option to query") + }, + {.name = "config", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("affect next boot") + }, + {.name = "live", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("affect running domain") + }, + {.name = "current", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("affect current domain") + }, + {.name = NULL} };
static bool @@ -5092,13 +5857,37 @@ static const vshCmdInfo info_setvcpus[] = { };
static const vshCmdOptDef opts_setvcpus[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"count", VSH_OT_INT, VSH_OFLAG_REQ, N_("number of virtual CPUs")}, - {"maximum", VSH_OT_BOOL, 0, N_("set maximum limit on next boot")}, - {"config", VSH_OT_BOOL, 0, N_("affect next boot")}, - {"live", VSH_OT_BOOL, 0, N_("affect running domain")}, - {"current", VSH_OT_BOOL, 0, N_("affect current domain")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "count", + .type = VSH_OT_INT, + .flags = VSH_OFLAG_REQ, + .help = N_("number of virtual CPUs") + }, + {.name = "maximum", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("set maximum limit on next boot") + }, + {.name = "config", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("affect next boot") + }, + {.name = "live", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("affect running domain") + }, + {.name = "current", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("affect current domain") + }, + {.name = NULL} };
static bool @@ -5183,8 +5972,12 @@ static const vshCmdInfo info_cpu_compare[] = { };
static const vshCmdOptDef opts_cpu_compare[] = { - {"file", VSH_OT_DATA, VSH_OFLAG_REQ, N_("file containing an XML CPU description")}, - {NULL, 0, 0, NULL} + {.name = "file", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("file containing an XML CPU description") + }, + {.name = NULL} };
static bool @@ -5280,8 +6073,12 @@ static const vshCmdInfo info_cpu_baseline[] = { };
static const vshCmdOptDef opts_cpu_baseline[] = { - {"file", VSH_OT_DATA, VSH_OFLAG_REQ, N_("file containing XML CPU descriptions")}, - {NULL, 0, 0, NULL} + {.name = "file", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("file containing XML CPU descriptions") + }, + {.name = NULL} };
static bool @@ -5382,11 +6179,27 @@ static const vshCmdInfo info_cpu_stats[] = { };
static const vshCmdOptDef opts_cpu_stats[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"total", VSH_OT_BOOL, 0, N_("Show total statistics only")}, - {"start", VSH_OT_INT, 0, N_("Show statistics from this CPU")}, - {"count", VSH_OT_INT, 0, N_("Number of shown CPUs at most")}, - {NULL, 0, 0, NULL}, + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "total", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("Show total statistics only") + }, + {.name = "start", + .type = VSH_OT_INT, + .flags = 0, + .help = N_("Show statistics from this CPU") + }, + {.name = "count", + .type = VSH_OT_INT, + .flags = 0, + .help = N_("Number of shown CPUs at most") + }, + {.name = NULL}, };
static bool @@ -5536,13 +6349,29 @@ static const vshCmdInfo info_create[] = { };
static const vshCmdOptDef opts_create[] = { - {"file", VSH_OT_DATA, VSH_OFLAG_REQ, N_("file containing an XML domain description")}, + {.name = "file", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("file containing an XML domain description") + }, #ifndef WIN32 - {"console", VSH_OT_BOOL, 0, N_("attach to console after creation")}, + {.name = "console", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("attach to console after creation") + }, #endif - {"paused", VSH_OT_BOOL, 0, N_("leave the guest paused after creation")}, - {"autodestroy", VSH_OT_BOOL, 0, N_("automatically destroy the guest when virsh disconnects")}, - {NULL, 0, 0, NULL} + {.name = "paused", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("leave the guest paused after creation") + }, + {.name = "autodestroy", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("automatically destroy the guest when virsh disconnects") + }, + {.name = NULL} };
static bool @@ -5596,8 +6425,12 @@ static const vshCmdInfo info_define[] = { };
static const vshCmdOptDef opts_define[] = { - {"file", VSH_OT_DATA, VSH_OFLAG_REQ, N_("file containing an XML domain description")}, - {NULL, 0, 0, NULL} + {.name = "file", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("file containing an XML domain description") + }, + {.name = NULL} };
static bool @@ -5639,9 +6472,17 @@ static const vshCmdInfo info_destroy[] = { };
static const vshCmdOptDef opts_destroy[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"graceful", VSH_OT_BOOL, VSH_OFLAG_NONE, N_("terminate gracefully")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "graceful", + .type = VSH_OT_BOOL, + .flags = VSH_OFLAG_NONE, + .help = N_("terminate gracefully") + }, + {.name = NULL} };
static bool @@ -5685,14 +6526,42 @@ static const vshCmdInfo info_desc[] = { };
static const vshCmdOptDef opts_desc[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"live", VSH_OT_BOOL, 0, N_("modify/get running state")}, - {"config", VSH_OT_BOOL, 0, N_("modify/get persistent configuration")}, - {"current", VSH_OT_BOOL, 0, N_("modify/get current state configuration")}, - {"title", VSH_OT_BOOL, 0, N_("modify/get the title instead of description")}, - {"edit", VSH_OT_BOOL, 0, N_("open an editor to modify the description")}, - {"new-desc", VSH_OT_ARGV, 0, N_("message")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "live", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("modify/get running state") + }, + {.name = "config", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("modify/get persistent configuration") + }, + {.name = "current", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("modify/get current state configuration") + }, + {.name = "title", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("modify/get the title instead of description") + }, + {.name = "edit", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("open an editor to modify the description") + }, + {.name = "new-desc", + .type = VSH_OT_ARGV, + .flags = 0, + .help = N_("message") + }, + {.name = NULL} };
static bool @@ -5838,8 +6707,12 @@ static const vshCmdInfo info_inject_nmi[] = { };
static const vshCmdOptDef opts_inject_nmi[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = NULL} };
static bool @@ -5868,13 +6741,27 @@ static const vshCmdInfo info_send_key[] = { };
static const vshCmdOptDef opts_send_key[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"codeset", VSH_OT_STRING, VSH_OFLAG_REQ_OPT, - N_("the codeset of keycodes, default:linux")}, - {"holdtime", VSH_OT_INT, VSH_OFLAG_REQ_OPT, - N_("the time (in milliseconds) how long the keys will be held")}, - {"keycode", VSH_OT_ARGV, VSH_OFLAG_REQ, N_("the key code")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "codeset", + .type = VSH_OT_STRING, + .flags = VSH_OFLAG_REQ_OPT, + .help = N_("the codeset of keycodes, default:linux") + }, + {.name = "holdtime", + .type = VSH_OT_INT, + .flags = VSH_OFLAG_REQ_OPT, + .help = N_("the time (in milliseconds) how long the keys will be held") + }, + {.name = "keycode", + .type = VSH_OT_ARGV, + .flags = VSH_OFLAG_REQ, + .help = N_("the key code") + }, + {.name = NULL} };
static int @@ -5950,10 +6837,22 @@ static const vshCmdInfo info_send_process_signal[] = { };
static const vshCmdOptDef opts_send_process_signal[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"pid", VSH_OT_DATA, VSH_OFLAG_REQ, N_("the process ID") }, - {"signame", VSH_OT_DATA, VSH_OFLAG_REQ, N_("the signal number or name") }, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "pid", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("the process ID") + }, + {.name = "signame", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("the signal number or name") + }, + {.name = NULL} };
VIR_ENUM_DECL(virDomainProcessSignal) @@ -6053,14 +6952,37 @@ static const vshCmdInfo info_setmem[] = { };
static const vshCmdOptDef opts_setmem[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"kilobytes", VSH_OT_ALIAS, 0, "size"}, - {"size", VSH_OT_INT, VSH_OFLAG_REQ, - N_("new memory size, as scaled integer (default KiB)")}, - {"config", VSH_OT_BOOL, 0, N_("affect next boot")}, - {"live", VSH_OT_BOOL, 0, N_("affect running domain")}, - {"current", VSH_OT_BOOL, 0, N_("affect current domain")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "kilobytes", + .type = VSH_OT_ALIAS, + .flags = 0, + .help = "size" + }, + {.name = "size", + .type = VSH_OT_INT, + .flags = VSH_OFLAG_REQ, + .help = N_("new memory size, as scaled integer (default KiB)") + }, + {.name = "config", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("affect next boot") + }, + {.name = "live", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("affect running domain") + }, + {.name = "current", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("affect current domain") + }, + {.name = NULL} };
static bool @@ -6132,14 +7054,37 @@ static const vshCmdInfo info_setmaxmem[] = { };
static const vshCmdOptDef opts_setmaxmem[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"kilobytes", VSH_OT_ALIAS, 0, "size"}, - {"size", VSH_OT_INT, VSH_OFLAG_REQ, - N_("new maximum memory size, as scaled integer (default KiB)")}, - {"config", VSH_OT_BOOL, 0, N_("affect next boot")}, - {"live", VSH_OT_BOOL, 0, N_("affect running domain")}, - {"current", VSH_OT_BOOL, 0, N_("affect current domain")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "kilobytes", + .type = VSH_OT_ALIAS, + .flags = 0, + .help = "size" + }, + {.name = "size", + .type = VSH_OT_INT, + .flags = VSH_OFLAG_REQ, + .help = N_("new maximum memory size, as scaled integer (default KiB)") + }, + {.name = "config", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("affect next boot") + }, + {.name = "live", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("affect running domain") + }, + {.name = "current", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("affect current domain") + }, + {.name = NULL} };
static bool @@ -6215,19 +7160,47 @@ static const vshCmdInfo info_memtune[] = { };
static const vshCmdOptDef opts_memtune[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"hard-limit", VSH_OT_INT, VSH_OFLAG_NONE, - N_("Max memory, as scaled integer (default KiB)")}, - {"soft-limit", VSH_OT_INT, VSH_OFLAG_NONE, - N_("Memory during contention, as scaled integer (default KiB)")}, - {"swap-hard-limit", VSH_OT_INT, VSH_OFLAG_NONE, - N_("Max memory plus swap, as scaled integer (default KiB)")}, - {"min-guarantee", VSH_OT_INT, VSH_OFLAG_NONE, - N_("Min guaranteed memory, as scaled integer (default KiB)")}, - {"config", VSH_OT_BOOL, 0, N_("affect next boot")}, - {"live", VSH_OT_BOOL, 0, N_("affect running domain")}, - {"current", VSH_OT_BOOL, 0, N_("affect current domain")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "hard-limit", + .type = VSH_OT_INT, + .flags = VSH_OFLAG_NONE, + .help = N_("Max memory, as scaled integer (default KiB)") + }, + {.name = "soft-limit", + .type = VSH_OT_INT, + .flags = VSH_OFLAG_NONE, + .help = N_("Memory during contention, as scaled integer (default KiB)") + }, + {.name = "swap-hard-limit", + .type = VSH_OT_INT, + .flags = VSH_OFLAG_NONE, + .help = N_("Max memory plus swap, as scaled integer (default KiB)") + }, + {.name = "min-guarantee", + .type = VSH_OT_INT, + .flags = VSH_OFLAG_NONE, + .help = N_("Min guaranteed memory, as scaled integer (default KiB)") + }, + {.name = "config", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("affect next boot") + }, + {.name = "live", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("affect running domain") + }, + {.name = "current", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("affect current domain") + }, + {.name = NULL} };
static int @@ -6416,15 +7389,37 @@ static const vshCmdInfo info_numatune[] = { };
static const vshCmdOptDef opts_numatune[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"mode", VSH_OT_DATA, VSH_OFLAG_NONE, - N_("NUMA mode, one of strict, preferred and interleave")}, - {"nodeset", VSH_OT_DATA, VSH_OFLAG_NONE, - N_("NUMA node selections to set")}, - {"config", VSH_OT_BOOL, 0, N_("affect next boot")}, - {"live", VSH_OT_BOOL, 0, N_("affect running domain")}, - {"current", VSH_OT_BOOL, 0, N_("affect current domain")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "mode", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_NONE, + .help = N_("NUMA mode, one of strict, preferred and interleave") + }, + {.name = "nodeset", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_NONE, + .help = N_("NUMA node selections to set") + }, + {.name = "config", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("affect next boot") + }, + {.name = "live", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("affect running domain") + }, + {.name = "current", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("affect current domain") + }, + {.name = NULL} };
static bool @@ -6567,12 +7562,27 @@ static const vshCmdInfo info_qemu_monitor_command[] = { };
static const vshCmdOptDef opts_qemu_monitor_command[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"hmp", VSH_OT_BOOL, 0, N_("command is in human monitor protocol")}, - {"pretty", VSH_OT_BOOL, 0, - N_("pretty-print any qemu monitor protocol output")}, - {"cmd", VSH_OT_ARGV, VSH_OFLAG_REQ, N_("command")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "hmp", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("command is in human monitor protocol") + }, + {.name = "pretty", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("pretty-print any qemu monitor protocol output") + }, + {.name = "cmd", + .type = VSH_OT_ARGV, + .flags = VSH_OFLAG_REQ, + .help = N_("command") + }, + {.name = NULL} };
static bool @@ -6649,8 +7659,12 @@ static const vshCmdInfo info_qemu_attach[] = { };
static const vshCmdOptDef opts_qemu_attach[] = { - {"pid", VSH_OT_DATA, VSH_OFLAG_REQ, N_("pid")}, - {NULL, 0, 0, NULL} + {.name = "pid", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("pid") + }, + {.name = NULL} };
static bool @@ -6692,12 +7706,32 @@ static const vshCmdInfo info_qemu_agent_command[] = { };
static const vshCmdOptDef opts_qemu_agent_command[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"timeout", VSH_OT_INT, VSH_OFLAG_REQ_OPT, N_("timeout seconds. must be positive.")}, - {"async", VSH_OT_BOOL, 0, N_("execute command without waiting for timeout")}, - {"block", VSH_OT_BOOL, 0, N_("execute command without timeout")}, - {"cmd", VSH_OT_ARGV, VSH_OFLAG_REQ, N_("command")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "timeout", + .type = VSH_OT_INT, + .flags = VSH_OFLAG_REQ_OPT, + .help = N_("timeout seconds. must be positive.") + }, + {.name = "async", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("execute command without waiting for timeout") + }, + {.name = "block", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("execute command without timeout") + }, + {.name = "cmd", + .type = VSH_OT_ARGV, + .flags = VSH_OFLAG_REQ, + .help = N_("command") + }, + {.name = NULL} };
static bool @@ -6780,12 +7814,32 @@ static const vshCmdInfo info_dumpxml[] = { };
static const vshCmdOptDef opts_dumpxml[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"inactive", VSH_OT_BOOL, 0, N_("show inactive defined XML")}, - {"security-info", VSH_OT_BOOL, 0, N_("include security sensitive information in XML dump")}, - {"update-cpu", VSH_OT_BOOL, 0, N_("update guest CPU according to host CPU")}, - {"migratable", VSH_OT_BOOL, 0, N_("provide XML suitable for migrations")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "inactive", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("show inactive defined XML") + }, + {.name = "security-info", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("include security sensitive information in XML dump") + }, + {.name = "update-cpu", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("update guest CPU according to host CPU") + }, + {.name = "migratable", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("provide XML suitable for migrations") + }, + {.name = NULL} };
static bool @@ -6834,9 +7888,17 @@ static const vshCmdInfo info_domxmlfromnative[] = { };
static const vshCmdOptDef opts_domxmlfromnative[] = { - {"format", VSH_OT_DATA, VSH_OFLAG_REQ, N_("source config data format")}, - {"config", VSH_OT_DATA, VSH_OFLAG_REQ, N_("config data file to import from")}, - {NULL, 0, 0, NULL} + {.name = "format", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("source config data format") + }, + {.name = "config", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("config data file to import from") + }, + {.name = NULL} };
static bool @@ -6878,9 +7940,17 @@ static const vshCmdInfo info_domxmltonative[] = { };
static const vshCmdOptDef opts_domxmltonative[] = { - {"format", VSH_OT_DATA, VSH_OFLAG_REQ, N_("target config data type format")}, - {"xml", VSH_OT_DATA, VSH_OFLAG_REQ, N_("xml data file to export from")}, - {NULL, 0, 0, NULL} + {.name = "format", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("target config data type format") + }, + {.name = "xml", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("xml data file to export from") + }, + {.name = NULL} };
static bool @@ -6922,8 +7992,12 @@ static const vshCmdInfo info_domname[] = { };
static const vshCmdOptDef opts_domname[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain id or uuid")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain id or uuid") + }, + {.name = NULL} };
static bool @@ -6950,8 +8024,12 @@ static const vshCmdInfo info_domid[] = { };
static const vshCmdOptDef opts_domid[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name or uuid")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name or uuid") + }, + {.name = NULL} };
static bool @@ -6983,8 +8061,12 @@ static const vshCmdInfo info_domuuid[] = { };
static const vshCmdOptDef opts_domuuid[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain id or name")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain id or name") + }, + {.name = NULL} };
static bool @@ -7016,28 +8098,107 @@ static const vshCmdInfo info_migrate[] = { };
static const vshCmdOptDef opts_migrate[] = { - {"live", VSH_OT_BOOL, 0, N_("live migration")}, - {"offline", VSH_OT_BOOL, 0, N_("offline migration")}, - {"p2p", VSH_OT_BOOL, 0, N_("peer-2-peer migration")}, - {"direct", VSH_OT_BOOL, 0, N_("direct migration")}, - {"tunneled", VSH_OT_ALIAS, 0, "tunnelled"}, - {"tunnelled", VSH_OT_BOOL, 0, N_("tunnelled migration")}, - {"persistent", VSH_OT_BOOL, 0, N_("persist VM on destination")}, - {"undefinesource", VSH_OT_BOOL, 0, N_("undefine VM on source")}, - {"suspend", VSH_OT_BOOL, 0, N_("do not restart the domain on the destination host")}, - {"copy-storage-all", VSH_OT_BOOL, 0, N_("migration with non-shared storage with full disk copy")}, - {"copy-storage-inc", VSH_OT_BOOL, 0, N_("migration with non-shared storage with incremental copy (same base image shared between source and destination)")}, - {"change-protection", VSH_OT_BOOL, 0, - N_("prevent any configuration changes to domain until migration ends)")}, - {"unsafe", VSH_OT_BOOL, 0, N_("force migration even if it may be unsafe")}, - {"verbose", VSH_OT_BOOL, 0, N_("display the progress of migration")}, - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"desturi", VSH_OT_DATA, VSH_OFLAG_REQ, N_("connection URI of the destination host as seen from the client(normal migration) or source(p2p migration)")}, - {"migrateuri", VSH_OT_DATA, 0, N_("migration URI, usually can be omitted")}, - {"dname", VSH_OT_DATA, 0, N_("rename to new name during migration (if supported)")}, - {"timeout", VSH_OT_INT, 0, N_("force guest to suspend if live migration exceeds timeout (in seconds)")}, - {"xml", VSH_OT_STRING, 0, N_("filename containing updated XML for the target")}, - {NULL, 0, 0, NULL} + {.name = "live", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("live migration") + }, + {.name = "offline", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("offline migration") + }, + {.name = "p2p", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("peer-2-peer migration") + }, + {.name = "direct", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("direct migration") + }, + {.name = "tunneled", + .type = VSH_OT_ALIAS, + .flags = 0, + .help = "tunnelled" + }, + {.name = "tunnelled", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("tunnelled migration") + }, + {.name = "persistent", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("persist VM on destination") + }, + {.name = "undefinesource", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("undefine VM on source") + }, + {.name = "suspend", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("do not restart the domain on the destination host") + }, + {.name = "copy-storage-all", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("migration with non-shared storage with full disk copy") + }, + {.name = "copy-storage-inc", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("migration with non-shared storage with incremental copy (same base image shared between source and destination)") + }, + {.name = "change-protection", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("prevent any configuration changes to domain until migration ends)") + }, + {.name = "unsafe", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("force migration even if it may be unsafe") + }, + {.name = "verbose", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("display the progress of migration") + }, + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "desturi", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("connection URI of the destination host as seen from the client(normal migration) or source(p2p migration)") + }, + {.name = "migrateuri", + .type = VSH_OT_DATA, + .flags = 0, + .help = N_("migration URI, usually can be omitted") + }, + {.name = "dname", + .type = VSH_OT_DATA, + .flags = 0, + .help = N_("rename to new name during migration (if supported)") + }, + {.name = "timeout", + .type = VSH_OT_INT, + .flags = 0, + .help = N_("force guest to suspend if live migration exceeds timeout (in seconds)") + }, + {.name = "xml", + .type = VSH_OT_STRING, + .flags = 0, + .help = N_("filename containing updated XML for the target") + }, + {.name = NULL} };
static void @@ -7232,9 +8393,17 @@ static const vshCmdInfo info_migrate_setmaxdowntime[] = { };
static const vshCmdOptDef opts_migrate_setmaxdowntime[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"downtime", VSH_OT_INT, VSH_OFLAG_REQ, N_("maximum tolerable downtime (in milliseconds) for migration")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "downtime", + .type = VSH_OT_INT, + .flags = VSH_OFLAG_REQ, + .help = N_("maximum tolerable downtime (in milliseconds) for migration") + }, + {.name = NULL} };
static bool @@ -7274,10 +8443,17 @@ static const vshCmdInfo info_migrate_setspeed[] = { };
static const vshCmdOptDef opts_migrate_setspeed[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"bandwidth", VSH_OT_INT, VSH_OFLAG_REQ, - N_("migration bandwidth limit in MiB/s")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "bandwidth", + .type = VSH_OT_INT, + .flags = VSH_OFLAG_REQ, + .help = N_("migration bandwidth limit in MiB/s") + }, + {.name = NULL} };
static bool @@ -7315,8 +8491,12 @@ static const vshCmdInfo info_migrate_getspeed[] = { };
static const vshCmdOptDef opts_migrate_getspeed[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = NULL} };
static bool @@ -7351,9 +8531,17 @@ static const vshCmdInfo info_domdisplay[] = { };
static const vshCmdOptDef opts_domdisplay[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"include-password", VSH_OT_BOOL, VSH_OFLAG_NONE, N_("includes the password into the connection URI if available")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "include-password", + .type = VSH_OT_BOOL, + .flags = VSH_OFLAG_NONE, + .help = N_("includes the password into the connection URI if available") + }, + {.name = NULL} };
static bool @@ -7522,8 +8710,12 @@ static const vshCmdInfo info_vncdisplay[] = { };
static const vshCmdOptDef opts_vncdisplay[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = NULL} };
static bool @@ -7587,8 +8779,12 @@ static const vshCmdInfo info_ttyconsole[] = { };
static const vshCmdOptDef opts_ttyconsole[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = NULL} };
static bool @@ -7639,8 +8835,12 @@ static const vshCmdInfo info_domhostname[] = { };
static const vshCmdOptDef opts_domhostname[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = NULL} };
static bool @@ -7925,11 +9125,27 @@ static const vshCmdInfo info_detach_device[] = { };
static const vshCmdOptDef opts_detach_device[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"file", VSH_OT_DATA, VSH_OFLAG_REQ, N_("XML file")}, - {"persistent", VSH_OT_ALIAS, 0, "config"}, - {"config", VSH_OT_BOOL, 0, N_("affect next boot")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "file", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("XML file") + }, + {.name = "persistent", + .type = VSH_OT_ALIAS, + .flags = 0, + .help = "config" + }, + {.name = "config", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("affect next boot") + }, + {.name = NULL} };
static bool @@ -7986,12 +9202,32 @@ static const vshCmdInfo info_update_device[] = { };
static const vshCmdOptDef opts_update_device[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"file", VSH_OT_DATA, VSH_OFLAG_REQ, N_("XML file")}, - {"persistent", VSH_OT_ALIAS, 0, "config"}, - {"config", VSH_OT_BOOL, 0, N_("affect next boot")}, - {"force", VSH_OT_BOOL, 0, N_("force device update")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "file", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("XML file") + }, + {.name = "persistent", + .type = VSH_OT_ALIAS, + .flags = 0, + .help = "config" + }, + {.name = "config", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("affect next boot") + }, + {.name = "force", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("force device update") + }, + {.name = NULL} };
static bool @@ -8053,12 +9289,32 @@ static const vshCmdInfo info_detach_interface[] = { };
static const vshCmdOptDef opts_detach_interface[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"type", VSH_OT_DATA, VSH_OFLAG_REQ, N_("network interface type")}, - {"mac", VSH_OT_STRING, 0, N_("MAC address")}, - {"persistent", VSH_OT_ALIAS, 0, "config"}, - {"config", VSH_OT_BOOL, 0, N_("affect next boot")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "type", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("network interface type") + }, + {.name = "mac", + .type = VSH_OT_STRING, + .flags = 0, + .help = N_("MAC address") + }, + {.name = "persistent", + .type = VSH_OT_ALIAS, + .flags = 0, + .help = "config" + }, + {.name = "config", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("affect next boot") + }, + {.name = NULL} };
static bool @@ -8414,11 +9670,27 @@ static const vshCmdInfo info_detach_disk[] = { };
static const vshCmdOptDef opts_detach_disk[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"target", VSH_OT_DATA, VSH_OFLAG_REQ, N_("target of disk device")}, - {"persistent", VSH_OT_ALIAS, 0, "config"}, - {"config", VSH_OT_BOOL, 0, N_("affect next boot")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "target", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("target of disk device") + }, + {.name = "persistent", + .type = VSH_OT_ALIAS, + .flags = 0, + .help = "config" + }, + {.name = "config", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("affect next boot") + }, + {.name = NULL} };
static bool @@ -8487,8 +9759,12 @@ static const vshCmdInfo info_edit[] = { };
static const vshCmdOptDef opts_edit[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = NULL} };
static bool @@ -8539,19 +9815,58 @@ static const vshCmdInfo info_change_media[] = { };
static const vshCmdOptDef opts_change_media[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"path", VSH_OT_DATA, VSH_OFLAG_REQ, N_("Fully-qualified path or " - "target of disk device")}, - {"source", VSH_OT_DATA, 0, N_("source of the media")}, - {"eject", VSH_OT_BOOL, 0, N_("Eject the media")}, - {"insert", VSH_OT_BOOL, 0, N_("Insert the media")}, - {"update", VSH_OT_BOOL, 0, N_("Update the media")}, - {"current", VSH_OT_BOOL, 0, N_("can be either or both of --live and --config, " - "depends on implementation of hypervisor driver")}, - {"live", VSH_OT_BOOL, 0, N_("alter live configuration of running domain")}, - {"config", VSH_OT_BOOL, 0, N_("alter persistent configuration, effect observed on next boot")}, - {"force", VSH_OT_BOOL, 0, N_("force media changing")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "path", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("Fully-qualified path or target of disk device") + }, + {.name = "source", + .type = VSH_OT_DATA, + .flags = 0, + .help = N_("source of the media") + }, + {.name = "eject", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("Eject the media") + }, + {.name = "insert", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("Insert the media") + }, + {.name = "update", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("Update the media") + }, + {.name = "current", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("can be either or both of --live and --config, " + "depends on implementation of hypervisor driver") + }, + {.name = "live", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("alter live configuration of running domain") + }, + {.name = "config", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("alter persistent configuration, effect observed on next boot") + }, + {.name = "force", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("force media changing") + }, + {.name = NULL} };
static bool @@ -8666,10 +9981,22 @@ static const vshCmdInfo info_domfstrim[] = { };
static const vshCmdOptDef opts_domfstrim[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"minimum", VSH_OT_INT, 0, N_("Just a hint to ignore contiguous " - "free ranges smaller than this (Bytes)")}, - {"mountpoint", VSH_OT_DATA, 0, N_("which mount point to trim")}, + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "minimum", + .type = VSH_OT_INT, + .flags = 0, + .help = N_("Just a hint to ignore contiguous " + "free ranges smaller than this (Bytes)") + }, + {.name = "mountpoint", + .type = VSH_OT_DATA, + .flags = 0, + .help = N_("which mount point to trim") + }, {NULL, 0, 0, NULL} }; static bool -- 1.8.0.2
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
ACK. -- Doug Goldstein

--- tools/virsh-domain-monitor.c | 279 +++++++++++++++++++++++++++++++++---------- 1 file changed, 217 insertions(+), 62 deletions(-) diff --git a/tools/virsh-domain-monitor.c b/tools/virsh-domain-monitor.c index f4940fa..f60ecba 100644 --- a/tools/virsh-domain-monitor.c +++ b/tools/virsh-domain-monitor.c @@ -296,8 +296,12 @@ static const vshCmdInfo info_dommemstat[] = { }; static const vshCmdOptDef opts_dommemstat[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = NULL} }; static bool @@ -351,9 +355,17 @@ static const vshCmdInfo info_domblkinfo[] = { }; static const vshCmdOptDef opts_domblkinfo[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"device", VSH_OT_DATA, VSH_OFLAG_REQ, N_("block device")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "device", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("block device") + }, + {.name = NULL} }; static bool @@ -395,12 +407,22 @@ static const vshCmdInfo info_domblklist[] = { }; static const vshCmdOptDef opts_domblklist[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"inactive", VSH_OT_BOOL, 0, - N_("get inactive rather than running configuration")}, - {"details", VSH_OT_BOOL, 0, - N_("additionally display the type and device value")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "inactive", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("get inactive rather than running configuration") + }, + {.name = "details", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("additionally display the type and device value") + }, + {.name = NULL} }; static bool @@ -501,10 +523,17 @@ static const vshCmdInfo info_domiflist[] = { }; static const vshCmdOptDef opts_domiflist[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"inactive", VSH_OT_BOOL, 0, - N_("get inactive rather than running configuration")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "inactive", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("get inactive rather than running configuration") + }, + {.name = NULL} }; static bool @@ -596,11 +625,27 @@ static const vshCmdInfo info_domif_getlink[] = { }; static const vshCmdOptDef opts_domif_getlink[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"interface", VSH_OT_DATA, VSH_OFLAG_REQ, N_("interface device (MAC Address)")}, - {"persistent", VSH_OT_ALIAS, 0, "config"}, - {"config", VSH_OT_BOOL, 0, N_("Get persistent interface state")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "interface", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("interface device (MAC Address)") + }, + {.name = "persistent", + .type = VSH_OT_ALIAS, + .flags = 0, + .help = "config" + }, + {.name = "config", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("Get persistent interface state") + }, + {.name = NULL} }; static bool @@ -723,8 +768,12 @@ static const vshCmdInfo info_domcontrol[] = { }; static const vshCmdOptDef opts_domcontrol[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = NULL} }; static bool @@ -768,10 +817,22 @@ static const vshCmdInfo info_domblkstat[] = { }; static const vshCmdOptDef opts_domblkstat[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"device", VSH_OT_DATA, VSH_OFLAG_REQ, N_("block device")}, - {"human", VSH_OT_BOOL, 0, N_("print a more human readable output")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "device", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("block device") + }, + {.name = "human", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("print a more human readable output") + }, + {.name = NULL} }; struct _domblkstat_sequence { @@ -937,9 +998,17 @@ static const vshCmdInfo info_domifstat[] = { }; static const vshCmdOptDef opts_domifstat[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"interface", VSH_OT_DATA, VSH_OFLAG_REQ, N_("interface device")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "interface", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("interface device") + }, + {.name = NULL} }; static bool @@ -1001,8 +1070,12 @@ static const vshCmdInfo info_domblkerror[] = { }; static const vshCmdOptDef opts_domblkerror[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id, or uuid")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id, or uuid") + }, + {.name = NULL} }; static bool @@ -1058,8 +1131,12 @@ static const vshCmdInfo info_dominfo[] = { }; static const vshCmdOptDef opts_dominfo[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = NULL} }; static bool @@ -1192,9 +1269,17 @@ static const vshCmdInfo info_domstate[] = { }; static const vshCmdOptDef opts_domstate[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"reason", VSH_OT_BOOL, 0, N_("also print reason for the state")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "reason", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("also print reason for the state") + }, + {.name = NULL} }; static bool @@ -1512,32 +1597,102 @@ cleanup: } static const vshCmdOptDef opts_list[] = { - {"inactive", VSH_OT_BOOL, 0, N_("list inactive domains")}, - {"all", VSH_OT_BOOL, 0, N_("list inactive & active domains")}, - {"transient", VSH_OT_BOOL, 0, N_("list transient domains")}, - {"persistent", VSH_OT_BOOL, 0, N_("list persistent domains")}, - {"with-snapshot", VSH_OT_BOOL, 0, - N_("list domains with existing snapshot")}, - {"without-snapshot", VSH_OT_BOOL, 0, - N_("list domains without a snapshot")}, - {"state-running", VSH_OT_BOOL, 0, N_("list domains in running state")}, - {"state-paused", VSH_OT_BOOL, 0, N_("list domains in paused state")}, - {"state-shutoff", VSH_OT_BOOL, 0, N_("list domains in shutoff state")}, - {"state-other", VSH_OT_BOOL, 0, N_("list domains in other states")}, - {"autostart", VSH_OT_BOOL, 0, N_("list domains with autostart enabled")}, - {"no-autostart", VSH_OT_BOOL, 0, - N_("list domains with autostart disabled")}, - {"with-managed-save", VSH_OT_BOOL, 0, - N_("list domains with managed save state")}, - {"without-managed-save", VSH_OT_BOOL, 0, - N_("list domains without managed save")}, - {"uuid", VSH_OT_BOOL, 0, N_("list uuid's only")}, - {"name", VSH_OT_BOOL, 0, N_("list domain names only")}, - {"table", VSH_OT_BOOL, 0, N_("list table (default)")}, - {"managed-save", VSH_OT_BOOL, 0, - N_("mark inactive domains with managed save state")}, - {"title", VSH_OT_BOOL, 0, N_("show short domain description")}, - {NULL, 0, 0, NULL} + {.name = "inactive", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("list inactive domains") + }, + {.name = "all", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("list inactive & active domains") + }, + {.name = "transient", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("list transient domains") + }, + {.name = "persistent", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("list persistent domains") + }, + {.name = "with-snapshot", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("list domains with existing snapshot") + }, + {.name = "without-snapshot", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("list domains without a snapshot") + }, + {.name = "state-running", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("list domains in running state") + }, + {.name = "state-paused", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("list domains in paused state") + }, + {.name = "state-shutoff", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("list domains in shutoff state") + }, + {.name = "state-other", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("list domains in other states") + }, + {.name = "autostart", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("list domains with autostart enabled") + }, + {.name = "no-autostart", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("list domains with autostart disabled") + }, + {.name = "with-managed-save", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("list domains with managed save state") + }, + {.name = "without-managed-save", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("list domains without managed save") + }, + {.name = "uuid", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("list uuid's only") + }, + {.name = "name", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("list domain names only") + }, + {.name = "table", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("list table (default)") + }, + {.name = "managed-save", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("mark inactive domains with managed save state") + }, + {.name = "title", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("show short domain description") + }, + {.name = NULL} }; #define FILTER(NAME, FLAG) \ -- 1.8.0.2

On Mon, Jan 14, 2013 at 9:59 AM, Michal Privoznik <mprivozn@redhat.com> wrote:
--- tools/virsh-domain-monitor.c | 279 +++++++++++++++++++++++++++++++++---------- 1 file changed, 217 insertions(+), 62 deletions(-)
diff --git a/tools/virsh-domain-monitor.c b/tools/virsh-domain-monitor.c index f4940fa..f60ecba 100644 --- a/tools/virsh-domain-monitor.c +++ b/tools/virsh-domain-monitor.c @@ -296,8 +296,12 @@ static const vshCmdInfo info_dommemstat[] = { };
static const vshCmdOptDef opts_dommemstat[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = NULL} };
static bool @@ -351,9 +355,17 @@ static const vshCmdInfo info_domblkinfo[] = { };
static const vshCmdOptDef opts_domblkinfo[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"device", VSH_OT_DATA, VSH_OFLAG_REQ, N_("block device")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "device", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("block device") + }, + {.name = NULL} };
static bool @@ -395,12 +407,22 @@ static const vshCmdInfo info_domblklist[] = { };
static const vshCmdOptDef opts_domblklist[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"inactive", VSH_OT_BOOL, 0, - N_("get inactive rather than running configuration")}, - {"details", VSH_OT_BOOL, 0, - N_("additionally display the type and device value")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "inactive", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("get inactive rather than running configuration") + }, + {.name = "details", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("additionally display the type and device value") + }, + {.name = NULL} };
static bool @@ -501,10 +523,17 @@ static const vshCmdInfo info_domiflist[] = { };
static const vshCmdOptDef opts_domiflist[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"inactive", VSH_OT_BOOL, 0, - N_("get inactive rather than running configuration")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "inactive", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("get inactive rather than running configuration") + }, + {.name = NULL} };
static bool @@ -596,11 +625,27 @@ static const vshCmdInfo info_domif_getlink[] = { };
static const vshCmdOptDef opts_domif_getlink[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"interface", VSH_OT_DATA, VSH_OFLAG_REQ, N_("interface device (MAC Address)")}, - {"persistent", VSH_OT_ALIAS, 0, "config"}, - {"config", VSH_OT_BOOL, 0, N_("Get persistent interface state")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "interface", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("interface device (MAC Address)") + }, + {.name = "persistent", + .type = VSH_OT_ALIAS, + .flags = 0, + .help = "config" + }, + {.name = "config", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("Get persistent interface state") + }, + {.name = NULL} };
static bool @@ -723,8 +768,12 @@ static const vshCmdInfo info_domcontrol[] = { };
static const vshCmdOptDef opts_domcontrol[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = NULL} };
static bool @@ -768,10 +817,22 @@ static const vshCmdInfo info_domblkstat[] = { };
static const vshCmdOptDef opts_domblkstat[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"device", VSH_OT_DATA, VSH_OFLAG_REQ, N_("block device")}, - {"human", VSH_OT_BOOL, 0, N_("print a more human readable output")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "device", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("block device") + }, + {.name = "human", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("print a more human readable output") + }, + {.name = NULL} };
struct _domblkstat_sequence { @@ -937,9 +998,17 @@ static const vshCmdInfo info_domifstat[] = { };
static const vshCmdOptDef opts_domifstat[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"interface", VSH_OT_DATA, VSH_OFLAG_REQ, N_("interface device")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "interface", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("interface device") + }, + {.name = NULL} };
static bool @@ -1001,8 +1070,12 @@ static const vshCmdInfo info_domblkerror[] = { };
static const vshCmdOptDef opts_domblkerror[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id, or uuid")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id, or uuid") + }, + {.name = NULL} };
static bool @@ -1058,8 +1131,12 @@ static const vshCmdInfo info_dominfo[] = { };
static const vshCmdOptDef opts_dominfo[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = NULL} };
static bool @@ -1192,9 +1269,17 @@ static const vshCmdInfo info_domstate[] = { };
static const vshCmdOptDef opts_domstate[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"reason", VSH_OT_BOOL, 0, N_("also print reason for the state")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "reason", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("also print reason for the state") + }, + {.name = NULL} };
static bool @@ -1512,32 +1597,102 @@ cleanup: }
static const vshCmdOptDef opts_list[] = { - {"inactive", VSH_OT_BOOL, 0, N_("list inactive domains")}, - {"all", VSH_OT_BOOL, 0, N_("list inactive & active domains")}, - {"transient", VSH_OT_BOOL, 0, N_("list transient domains")}, - {"persistent", VSH_OT_BOOL, 0, N_("list persistent domains")}, - {"with-snapshot", VSH_OT_BOOL, 0, - N_("list domains with existing snapshot")}, - {"without-snapshot", VSH_OT_BOOL, 0, - N_("list domains without a snapshot")}, - {"state-running", VSH_OT_BOOL, 0, N_("list domains in running state")}, - {"state-paused", VSH_OT_BOOL, 0, N_("list domains in paused state")}, - {"state-shutoff", VSH_OT_BOOL, 0, N_("list domains in shutoff state")}, - {"state-other", VSH_OT_BOOL, 0, N_("list domains in other states")}, - {"autostart", VSH_OT_BOOL, 0, N_("list domains with autostart enabled")}, - {"no-autostart", VSH_OT_BOOL, 0, - N_("list domains with autostart disabled")}, - {"with-managed-save", VSH_OT_BOOL, 0, - N_("list domains with managed save state")}, - {"without-managed-save", VSH_OT_BOOL, 0, - N_("list domains without managed save")}, - {"uuid", VSH_OT_BOOL, 0, N_("list uuid's only")}, - {"name", VSH_OT_BOOL, 0, N_("list domain names only")}, - {"table", VSH_OT_BOOL, 0, N_("list table (default)")}, - {"managed-save", VSH_OT_BOOL, 0, - N_("mark inactive domains with managed save state")}, - {"title", VSH_OT_BOOL, 0, N_("show short domain description")}, - {NULL, 0, 0, NULL} + {.name = "inactive", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("list inactive domains") + }, + {.name = "all", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("list inactive & active domains") + }, + {.name = "transient", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("list transient domains") + }, + {.name = "persistent", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("list persistent domains") + }, + {.name = "with-snapshot", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("list domains with existing snapshot") + }, + {.name = "without-snapshot", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("list domains without a snapshot") + }, + {.name = "state-running", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("list domains in running state") + }, + {.name = "state-paused", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("list domains in paused state") + }, + {.name = "state-shutoff", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("list domains in shutoff state") + }, + {.name = "state-other", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("list domains in other states") + }, + {.name = "autostart", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("list domains with autostart enabled") + }, + {.name = "no-autostart", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("list domains with autostart disabled") + }, + {.name = "with-managed-save", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("list domains with managed save state") + }, + {.name = "without-managed-save", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("list domains without managed save") + }, + {.name = "uuid", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("list uuid's only") + }, + {.name = "name", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("list domain names only") + }, + {.name = "table", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("list table (default)") + }, + {.name = "managed-save", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("mark inactive domains with managed save state") + }, + {.name = "title", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("show short domain description") + }, + {.name = NULL} };
#define FILTER(NAME, FLAG) \ -- 1.8.0.2
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
ACK. -- Doug Goldstein

--- tools/virsh-host.c | 102 +++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 75 insertions(+), 27 deletions(-) diff --git a/tools/virsh-host.c b/tools/virsh-host.c index 352c49a..fe9a7af 100644 --- a/tools/virsh-host.c +++ b/tools/virsh-host.c @@ -74,10 +74,17 @@ static const vshCmdInfo info_connect[] = { }; static const vshCmdOptDef opts_connect[] = { - {"name", VSH_OT_DATA, VSH_OFLAG_EMPTY_OK, - N_("hypervisor connection URI")}, - {"readonly", VSH_OT_BOOL, 0, N_("read-only connection")}, - {NULL, 0, 0, NULL} + {.name = "name", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_EMPTY_OK, + .help = N_("hypervisor connection URI") + }, + {.name = "readonly", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("read-only connection") + }, + {.name = NULL} }; static bool @@ -125,9 +132,17 @@ static const vshCmdInfo info_freecell[] = { }; static const vshCmdOptDef opts_freecell[] = { - {"cellno", VSH_OT_INT, 0, N_("NUMA cell number")}, - {"all", VSH_OT_BOOL, 0, N_("show free memory for all NUMA cells")}, - {NULL, 0, 0, NULL} + {.name = "cellno", + .type = VSH_OT_INT, + .flags = 0, + .help = N_("NUMA cell number") + }, + {.name = "all", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("show free memory for all NUMA cells") + }, + {.name = NULL} }; static bool @@ -318,9 +333,17 @@ static const vshCmdInfo info_nodecpustats[] = { }; static const vshCmdOptDef opts_node_cpustats[] = { - {"cpu", VSH_OT_INT, 0, N_("prints specified cpu statistics only.")}, - {"percent", VSH_OT_BOOL, 0, N_("prints by percentage during 1 second.")}, - {NULL, 0, 0, NULL} + {.name = "cpu", + .type = VSH_OT_INT, + .flags = 0, + .help = N_("prints specified cpu statistics only.") + }, + {.name = "percent", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("prints by percentage during 1 second.") + }, + {.name = NULL} }; static bool @@ -443,8 +466,12 @@ static const vshCmdInfo info_nodememstats[] = { }; static const vshCmdOptDef opts_node_memstats[] = { - {"cell", VSH_OT_INT, 0, N_("prints specified cell statistics only.")}, - {NULL, 0, 0, NULL} + {.name = "cell", + .type = VSH_OT_INT, + .flags = 0, + .help = N_("prints specified cell statistics only.") + }, + {.name = NULL} }; static bool @@ -502,10 +529,18 @@ static const vshCmdInfo info_nodesuspend[] = { }; static const vshCmdOptDef opts_node_suspend[] = { - {"target", VSH_OT_DATA, VSH_OFLAG_REQ, N_("mem(Suspend-to-RAM), " - "disk(Suspend-to-Disk), hybrid(Hybrid-Suspend)")}, - {"duration", VSH_OT_INT, VSH_OFLAG_REQ, N_("Suspend duration in seconds, at least 60")}, - {NULL, 0, 0, NULL} + {.name = "target", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("mem(Suspend-to-RAM), " + "disk(Suspend-to-Disk), hybrid(Hybrid-Suspend)") + }, + {.name = "duration", + .type = VSH_OT_INT, + .flags = VSH_OFLAG_REQ, + .help = N_("Suspend duration in seconds, at least 60") + }, + {.name = NULL} }; static bool @@ -637,8 +672,12 @@ static const vshCmdInfo info_version[] = { }; static const vshCmdOptDef opts_version[] = { - {"daemon", VSH_OT_BOOL, VSH_OFLAG_NONE, N_("report daemon version too")}, - {NULL, 0, 0, NULL} + {.name = "daemon", + .type = VSH_OT_BOOL, + .flags = VSH_OFLAG_NONE, + .help = N_("report daemon version too") + }, + {.name = NULL} }; static bool @@ -732,15 +771,24 @@ static const vshCmdInfo info_node_memory_tune[] = { }; static const vshCmdOptDef opts_node_memory_tune[] = { - {"shm-pages-to-scan", VSH_OT_INT, VSH_OFLAG_NONE, - N_("number of pages to scan before the shared memory service " - "goes to sleep")}, - {"shm-sleep-millisecs", VSH_OT_INT, VSH_OFLAG_NONE, - N_("number of millisecs the shared memory service should " - "sleep before next scan")}, - {"shm-merge-across-nodes", VSH_OT_INT, VSH_OFLAG_NONE, - N_("Specifies if pages from different numa nodes can be merged")}, - {NULL, 0, 0, NULL} + {.name = "shm-pages-to-scan", + .type = VSH_OT_INT, + .flags = VSH_OFLAG_NONE, + .help = N_("number of pages to scan before the shared memory service " + "goes to sleep") + }, + {.name = "shm-sleep-millisecs", + .type = VSH_OT_INT, + .flags = VSH_OFLAG_NONE, + .help = N_("number of millisecs the shared memory service should " + "sleep before next scan") + }, + {.name = "shm-merge-across-nodes", + .type = VSH_OT_INT, + .flags = VSH_OFLAG_NONE, + .help = N_("Specifies if pages from different numa nodes can be merged") + }, + {.name = NULL} }; static bool -- 1.8.0.2

On Mon, Jan 14, 2013 at 9:59 AM, Michal Privoznik <mprivozn@redhat.com> wrote:
--- tools/virsh-host.c | 102 +++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 75 insertions(+), 27 deletions(-)
diff --git a/tools/virsh-host.c b/tools/virsh-host.c index 352c49a..fe9a7af 100644 --- a/tools/virsh-host.c +++ b/tools/virsh-host.c @@ -74,10 +74,17 @@ static const vshCmdInfo info_connect[] = { };
static const vshCmdOptDef opts_connect[] = { - {"name", VSH_OT_DATA, VSH_OFLAG_EMPTY_OK, - N_("hypervisor connection URI")}, - {"readonly", VSH_OT_BOOL, 0, N_("read-only connection")}, - {NULL, 0, 0, NULL} + {.name = "name", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_EMPTY_OK, + .help = N_("hypervisor connection URI") + }, + {.name = "readonly", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("read-only connection") + }, + {.name = NULL} };
static bool @@ -125,9 +132,17 @@ static const vshCmdInfo info_freecell[] = { };
static const vshCmdOptDef opts_freecell[] = { - {"cellno", VSH_OT_INT, 0, N_("NUMA cell number")}, - {"all", VSH_OT_BOOL, 0, N_("show free memory for all NUMA cells")}, - {NULL, 0, 0, NULL} + {.name = "cellno", + .type = VSH_OT_INT, + .flags = 0, + .help = N_("NUMA cell number") + }, + {.name = "all", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("show free memory for all NUMA cells") + }, + {.name = NULL} };
static bool @@ -318,9 +333,17 @@ static const vshCmdInfo info_nodecpustats[] = { };
static const vshCmdOptDef opts_node_cpustats[] = { - {"cpu", VSH_OT_INT, 0, N_("prints specified cpu statistics only.")}, - {"percent", VSH_OT_BOOL, 0, N_("prints by percentage during 1 second.")}, - {NULL, 0, 0, NULL} + {.name = "cpu", + .type = VSH_OT_INT, + .flags = 0, + .help = N_("prints specified cpu statistics only.") + }, + {.name = "percent", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("prints by percentage during 1 second.") + }, + {.name = NULL} };
static bool @@ -443,8 +466,12 @@ static const vshCmdInfo info_nodememstats[] = { };
static const vshCmdOptDef opts_node_memstats[] = { - {"cell", VSH_OT_INT, 0, N_("prints specified cell statistics only.")}, - {NULL, 0, 0, NULL} + {.name = "cell", + .type = VSH_OT_INT, + .flags = 0, + .help = N_("prints specified cell statistics only.") + }, + {.name = NULL} };
static bool @@ -502,10 +529,18 @@ static const vshCmdInfo info_nodesuspend[] = { };
static const vshCmdOptDef opts_node_suspend[] = { - {"target", VSH_OT_DATA, VSH_OFLAG_REQ, N_("mem(Suspend-to-RAM), " - "disk(Suspend-to-Disk), hybrid(Hybrid-Suspend)")}, - {"duration", VSH_OT_INT, VSH_OFLAG_REQ, N_("Suspend duration in seconds, at least 60")}, - {NULL, 0, 0, NULL} + {.name = "target", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("mem(Suspend-to-RAM), " + "disk(Suspend-to-Disk), hybrid(Hybrid-Suspend)") + }, + {.name = "duration", + .type = VSH_OT_INT, + .flags = VSH_OFLAG_REQ, + .help = N_("Suspend duration in seconds, at least 60") + }, + {.name = NULL} };
static bool @@ -637,8 +672,12 @@ static const vshCmdInfo info_version[] = { };
static const vshCmdOptDef opts_version[] = { - {"daemon", VSH_OT_BOOL, VSH_OFLAG_NONE, N_("report daemon version too")}, - {NULL, 0, 0, NULL} + {.name = "daemon", + .type = VSH_OT_BOOL, + .flags = VSH_OFLAG_NONE, + .help = N_("report daemon version too") + }, + {.name = NULL} };
static bool @@ -732,15 +771,24 @@ static const vshCmdInfo info_node_memory_tune[] = { };
static const vshCmdOptDef opts_node_memory_tune[] = { - {"shm-pages-to-scan", VSH_OT_INT, VSH_OFLAG_NONE, - N_("number of pages to scan before the shared memory service " - "goes to sleep")}, - {"shm-sleep-millisecs", VSH_OT_INT, VSH_OFLAG_NONE, - N_("number of millisecs the shared memory service should " - "sleep before next scan")}, - {"shm-merge-across-nodes", VSH_OT_INT, VSH_OFLAG_NONE, - N_("Specifies if pages from different numa nodes can be merged")}, - {NULL, 0, 0, NULL} + {.name = "shm-pages-to-scan", + .type = VSH_OT_INT, + .flags = VSH_OFLAG_NONE, + .help = N_("number of pages to scan before the shared memory service " + "goes to sleep") + }, + {.name = "shm-sleep-millisecs", + .type = VSH_OT_INT, + .flags = VSH_OFLAG_NONE, + .help = N_("number of millisecs the shared memory service should " + "sleep before next scan") + }, + {.name = "shm-merge-across-nodes", + .type = VSH_OT_INT, + .flags = VSH_OFLAG_NONE, + .help = N_("Specifies if pages from different numa nodes can be merged") + }, + {.name = NULL} };
static bool -- 1.8.0.2
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
ACK. -- Doug Goldstein

--- tools/virsh-interface.c | 138 ++++++++++++++++++++++++++++++++++++------------ 1 file changed, 104 insertions(+), 34 deletions(-) diff --git a/tools/virsh-interface.c b/tools/virsh-interface.c index cd14e89..20ce658 100644 --- a/tools/virsh-interface.c +++ b/tools/virsh-interface.c @@ -89,8 +89,12 @@ static const vshCmdInfo info_interface_edit[] = { }; static const vshCmdOptDef opts_interface_edit[] = { - {"interface", VSH_OT_DATA, VSH_OFLAG_REQ, N_("interface name or MAC address")}, - {NULL, 0, 0, NULL} + {.name = "interface", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("interface name or MAC address") + }, + {.name = NULL} }; static bool @@ -311,9 +315,17 @@ static const vshCmdInfo info_interface_list[] = { }; static const vshCmdOptDef opts_interface_list[] = { - {"inactive", VSH_OT_BOOL, 0, N_("list inactive interfaces")}, - {"all", VSH_OT_BOOL, 0, N_("list inactive & active interfaces")}, - {NULL, 0, 0, NULL} + {.name = "inactive", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("list inactive interfaces") + }, + {.name = "all", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("list inactive & active interfaces") + }, + {.name = NULL} }; static bool @@ -361,8 +373,12 @@ static const vshCmdInfo info_interface_name[] = { }; static const vshCmdOptDef opts_interface_name[] = { - {"interface", VSH_OT_DATA, VSH_OFLAG_REQ, N_("interface mac")}, - {NULL, 0, 0, NULL} + {.name = "interface", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("interface mac") + }, + {.name = NULL} }; static bool @@ -389,8 +405,12 @@ static const vshCmdInfo info_interface_mac[] = { }; static const vshCmdOptDef opts_interface_mac[] = { - {"interface", VSH_OT_DATA, VSH_OFLAG_REQ, N_("interface name")}, - {NULL, 0, 0, NULL} + {.name = "interface", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("interface name") + }, + {.name = NULL} }; static bool @@ -417,9 +437,17 @@ static const vshCmdInfo info_interface_dumpxml[] = { }; static const vshCmdOptDef opts_interface_dumpxml[] = { - {"interface", VSH_OT_DATA, VSH_OFLAG_REQ, N_("interface name or MAC address")}, - {"inactive", VSH_OT_BOOL, 0, N_("show inactive defined XML")}, - {NULL, 0, 0, NULL} + {.name = "interface", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("interface name or MAC address") + }, + {.name = "inactive", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("show inactive defined XML") + }, + {.name = NULL} }; static bool @@ -459,8 +487,12 @@ static const vshCmdInfo info_interface_define[] = { }; static const vshCmdOptDef opts_interface_define[] = { - {"file", VSH_OT_DATA, VSH_OFLAG_REQ, N_("file containing an XML interface description")}, - {NULL, 0, 0, NULL} + {.name = "file", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("file containing an XML interface description") + }, + {.name = NULL} }; static bool @@ -501,8 +533,12 @@ static const vshCmdInfo info_interface_undefine[] = { }; static const vshCmdOptDef opts_interface_undefine[] = { - {"interface", VSH_OT_DATA, VSH_OFLAG_REQ, N_("interface name or MAC address")}, - {NULL, 0, 0, NULL} + {.name = "interface", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("interface name or MAC address") + }, + {.name = NULL} }; static bool @@ -536,8 +572,12 @@ static const vshCmdInfo info_interface_start[] = { }; static const vshCmdOptDef opts_interface_start[] = { - {"interface", VSH_OT_DATA, VSH_OFLAG_REQ, N_("interface name or MAC address")}, - {NULL, 0, 0, NULL} + {.name = "interface", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("interface name or MAC address") + }, + {.name = NULL} }; static bool @@ -571,8 +611,12 @@ static const vshCmdInfo info_interface_destroy[] = { }; static const vshCmdOptDef opts_interface_destroy[] = { - {"interface", VSH_OT_DATA, VSH_OFLAG_REQ, N_("interface name or MAC address")}, - {NULL, 0, 0, NULL} + {.name = "interface", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("interface name or MAC address") + }, + {.name = NULL} }; static bool @@ -608,7 +652,7 @@ static const vshCmdInfo info_interface_begin[] = { }; static const vshCmdOptDef opts_interface_begin[] = { - {NULL, 0, 0, NULL} + {.name = NULL} }; static bool @@ -633,7 +677,7 @@ static const vshCmdInfo info_interface_commit[] = { }; static const vshCmdOptDef opts_interface_commit[] = { - {NULL, 0, 0, NULL} + {.name = NULL} }; static bool @@ -658,7 +702,7 @@ static const vshCmdInfo info_interface_rollback[] = { }; static const vshCmdOptDef opts_interface_rollback[] = { - {NULL, 0, 0, NULL} + {.name = NULL} }; static bool @@ -683,13 +727,32 @@ static const vshCmdInfo info_interface_bridge[] = { }; static const vshCmdOptDef opts_interface_bridge[] = { - {"interface", VSH_OT_DATA, VSH_OFLAG_REQ, N_("existing interface name")}, - {"bridge", VSH_OT_DATA, VSH_OFLAG_REQ, N_("new bridge device name")}, - {"no-stp", VSH_OT_BOOL, 0, N_("do not enable STP for this bridge")}, - {"delay", VSH_OT_INT, 0, - N_("number of seconds to squelch traffic on newly connected ports")}, - {"no-start", VSH_OT_BOOL, 0, N_("don't start the bridge immediately")}, - {NULL, 0, 0, NULL} + {.name = "interface", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("existing interface name") + }, + {.name = "bridge", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("new bridge device name") + }, + {.name = "no-stp", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("do not enable STP for this bridge") + }, + {.name = "delay", + .type = VSH_OT_INT, + .flags = 0, + .help = N_("number of seconds to squelch traffic on newly connected ports") + }, + {.name = "no-start", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("don't start the bridge immediately") + }, + {.name = NULL} }; static bool @@ -901,10 +964,17 @@ static const vshCmdInfo info_interface_unbridge[] = { }; static const vshCmdOptDef opts_interface_unbridge[] = { - {"bridge", VSH_OT_DATA, VSH_OFLAG_REQ, N_("current bridge device name")}, - {"no-start", VSH_OT_BOOL, 0, - N_("don't start the un-slaved interface immediately (not recommended)")}, - {NULL, 0, 0, NULL} + {.name = "bridge", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("current bridge device name") + }, + {.name = "no-start", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("don't start the un-slaved interface immediately (not recommended)") + }, + {.name = NULL} }; static bool -- 1.8.0.2

On Mon, Jan 14, 2013 at 9:59 AM, Michal Privoznik <mprivozn@redhat.com> wrote:
--- tools/virsh-interface.c | 138 ++++++++++++++++++++++++++++++++++++------------ 1 file changed, 104 insertions(+), 34 deletions(-)
diff --git a/tools/virsh-interface.c b/tools/virsh-interface.c index cd14e89..20ce658 100644 --- a/tools/virsh-interface.c +++ b/tools/virsh-interface.c @@ -89,8 +89,12 @@ static const vshCmdInfo info_interface_edit[] = { };
static const vshCmdOptDef opts_interface_edit[] = { - {"interface", VSH_OT_DATA, VSH_OFLAG_REQ, N_("interface name or MAC address")}, - {NULL, 0, 0, NULL} + {.name = "interface", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("interface name or MAC address") + }, + {.name = NULL} };
static bool @@ -311,9 +315,17 @@ static const vshCmdInfo info_interface_list[] = { };
static const vshCmdOptDef opts_interface_list[] = { - {"inactive", VSH_OT_BOOL, 0, N_("list inactive interfaces")}, - {"all", VSH_OT_BOOL, 0, N_("list inactive & active interfaces")}, - {NULL, 0, 0, NULL} + {.name = "inactive", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("list inactive interfaces") + }, + {.name = "all", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("list inactive & active interfaces") + }, + {.name = NULL} };
static bool @@ -361,8 +373,12 @@ static const vshCmdInfo info_interface_name[] = { };
static const vshCmdOptDef opts_interface_name[] = { - {"interface", VSH_OT_DATA, VSH_OFLAG_REQ, N_("interface mac")}, - {NULL, 0, 0, NULL} + {.name = "interface", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("interface mac") + }, + {.name = NULL} };
static bool @@ -389,8 +405,12 @@ static const vshCmdInfo info_interface_mac[] = { };
static const vshCmdOptDef opts_interface_mac[] = { - {"interface", VSH_OT_DATA, VSH_OFLAG_REQ, N_("interface name")}, - {NULL, 0, 0, NULL} + {.name = "interface", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("interface name") + }, + {.name = NULL} };
static bool @@ -417,9 +437,17 @@ static const vshCmdInfo info_interface_dumpxml[] = { };
static const vshCmdOptDef opts_interface_dumpxml[] = { - {"interface", VSH_OT_DATA, VSH_OFLAG_REQ, N_("interface name or MAC address")}, - {"inactive", VSH_OT_BOOL, 0, N_("show inactive defined XML")}, - {NULL, 0, 0, NULL} + {.name = "interface", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("interface name or MAC address") + }, + {.name = "inactive", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("show inactive defined XML") + }, + {.name = NULL} };
static bool @@ -459,8 +487,12 @@ static const vshCmdInfo info_interface_define[] = { };
static const vshCmdOptDef opts_interface_define[] = { - {"file", VSH_OT_DATA, VSH_OFLAG_REQ, N_("file containing an XML interface description")}, - {NULL, 0, 0, NULL} + {.name = "file", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("file containing an XML interface description") + }, + {.name = NULL} };
static bool @@ -501,8 +533,12 @@ static const vshCmdInfo info_interface_undefine[] = { };
static const vshCmdOptDef opts_interface_undefine[] = { - {"interface", VSH_OT_DATA, VSH_OFLAG_REQ, N_("interface name or MAC address")}, - {NULL, 0, 0, NULL} + {.name = "interface", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("interface name or MAC address") + }, + {.name = NULL} };
static bool @@ -536,8 +572,12 @@ static const vshCmdInfo info_interface_start[] = { };
static const vshCmdOptDef opts_interface_start[] = { - {"interface", VSH_OT_DATA, VSH_OFLAG_REQ, N_("interface name or MAC address")}, - {NULL, 0, 0, NULL} + {.name = "interface", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("interface name or MAC address") + }, + {.name = NULL} };
static bool @@ -571,8 +611,12 @@ static const vshCmdInfo info_interface_destroy[] = { };
static const vshCmdOptDef opts_interface_destroy[] = { - {"interface", VSH_OT_DATA, VSH_OFLAG_REQ, N_("interface name or MAC address")}, - {NULL, 0, 0, NULL} + {.name = "interface", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("interface name or MAC address") + }, + {.name = NULL} };
static bool @@ -608,7 +652,7 @@ static const vshCmdInfo info_interface_begin[] = { };
static const vshCmdOptDef opts_interface_begin[] = { - {NULL, 0, 0, NULL} + {.name = NULL} };
static bool @@ -633,7 +677,7 @@ static const vshCmdInfo info_interface_commit[] = { };
static const vshCmdOptDef opts_interface_commit[] = { - {NULL, 0, 0, NULL} + {.name = NULL} };
static bool @@ -658,7 +702,7 @@ static const vshCmdInfo info_interface_rollback[] = { };
static const vshCmdOptDef opts_interface_rollback[] = { - {NULL, 0, 0, NULL} + {.name = NULL} };
static bool @@ -683,13 +727,32 @@ static const vshCmdInfo info_interface_bridge[] = { };
static const vshCmdOptDef opts_interface_bridge[] = { - {"interface", VSH_OT_DATA, VSH_OFLAG_REQ, N_("existing interface name")}, - {"bridge", VSH_OT_DATA, VSH_OFLAG_REQ, N_("new bridge device name")}, - {"no-stp", VSH_OT_BOOL, 0, N_("do not enable STP for this bridge")}, - {"delay", VSH_OT_INT, 0, - N_("number of seconds to squelch traffic on newly connected ports")}, - {"no-start", VSH_OT_BOOL, 0, N_("don't start the bridge immediately")}, - {NULL, 0, 0, NULL} + {.name = "interface", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("existing interface name") + }, + {.name = "bridge", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("new bridge device name") + }, + {.name = "no-stp", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("do not enable STP for this bridge") + }, + {.name = "delay", + .type = VSH_OT_INT, + .flags = 0, + .help = N_("number of seconds to squelch traffic on newly connected ports") + }, + {.name = "no-start", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("don't start the bridge immediately") + }, + {.name = NULL} };
static bool @@ -901,10 +964,17 @@ static const vshCmdInfo info_interface_unbridge[] = { };
static const vshCmdOptDef opts_interface_unbridge[] = { - {"bridge", VSH_OT_DATA, VSH_OFLAG_REQ, N_("current bridge device name")}, - {"no-start", VSH_OT_BOOL, 0, - N_("don't start the un-slaved interface immediately (not recommended)")}, - {NULL, 0, 0, NULL} + {.name = "bridge", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("current bridge device name") + }, + {.name = "no-start", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("don't start the un-slaved interface immediately (not recommended)") + }, + {.name = NULL} };
static bool -- 1.8.0.2
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
ACK. -- Doug Goldstein

On 14.01.2013 21:21, Doug Goldstein wrote:
On Mon, Jan 14, 2013 at 9:59 AM, Michal Privoznik <mprivozn@redhat.com> wrote:
--- tools/virsh-interface.c | 138 ++++++++++++++++++++++++++++++++++++------------ 1 file changed, 104 insertions(+), 34 deletions(-)
ACK.
Thanks, is anybody willing to continue the review? Thanks in advance! Michal

--- tools/virsh-network.c | 193 ++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 149 insertions(+), 44 deletions(-) diff --git a/tools/virsh-network.c b/tools/virsh-network.c index fc73a28..9ba3ca8 100644 --- a/tools/virsh-network.c +++ b/tools/virsh-network.c @@ -89,9 +89,17 @@ static const vshCmdInfo info_network_autostart[] = { }; static const vshCmdOptDef opts_network_autostart[] = { - {"network", VSH_OT_DATA, VSH_OFLAG_REQ, N_("network name or uuid")}, - {"disable", VSH_OT_BOOL, 0, N_("disable autostarting")}, - {NULL, 0, 0, NULL} + {.name = "network", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("network name or uuid") + }, + {.name = "disable", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("disable autostarting") + }, + {.name = NULL} }; static bool @@ -134,8 +142,12 @@ static const vshCmdInfo info_network_create[] = { }; static const vshCmdOptDef opts_network_create[] = { - {"file", VSH_OT_DATA, VSH_OFLAG_REQ, N_("file containing an XML network description")}, - {NULL, 0, 0, NULL} + {.name = "file", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("file containing an XML network description") + }, + {.name = NULL} }; static bool @@ -176,8 +188,12 @@ static const vshCmdInfo info_network_define[] = { }; static const vshCmdOptDef opts_network_define[] = { - {"file", VSH_OT_DATA, VSH_OFLAG_REQ, N_("file containing an XML network description")}, - {NULL, 0, 0, NULL} + {.name = "file", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("file containing an XML network description") + }, + {.name = NULL} }; static bool @@ -218,8 +234,12 @@ static const vshCmdInfo info_network_destroy[] = { }; static const vshCmdOptDef opts_network_destroy[] = { - {"network", VSH_OT_DATA, VSH_OFLAG_REQ, N_("network name or uuid")}, - {NULL, 0, 0, NULL} + {.name = "network", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("network name or uuid") + }, + {.name = NULL} }; static bool @@ -253,9 +273,17 @@ static const vshCmdInfo info_network_dumpxml[] = { }; static const vshCmdOptDef opts_network_dumpxml[] = { - {"network", VSH_OT_DATA, VSH_OFLAG_REQ, N_("network name or uuid")}, - {"inactive", VSH_OT_BOOL, VSH_OFLAG_NONE, N_("network information of an inactive domain")}, - {NULL, 0, 0, NULL} + {.name = "network", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("network name or uuid") + }, + {.name = "inactive", + .type = VSH_OT_BOOL, + .flags = VSH_OFLAG_NONE, + .help = N_("network information of an inactive domain") + }, + {.name = NULL} }; static bool @@ -297,8 +325,12 @@ static const vshCmdInfo info_network_info[] = { }; static const vshCmdOptDef opts_network_info[] = { - {"network", VSH_OT_DATA, VSH_OFLAG_REQ, N_("network name or uuid")}, - {NULL, 0, 0, NULL} + {.name = "network", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("network name or uuid") + }, + {.name = NULL} }; static bool @@ -570,13 +602,37 @@ static const vshCmdInfo info_network_list[] = { }; static const vshCmdOptDef opts_network_list[] = { - {"inactive", VSH_OT_BOOL, 0, N_("list inactive networks")}, - {"all", VSH_OT_BOOL, 0, N_("list inactive & active networks")}, - {"persistent", VSH_OT_BOOL, 0, N_("list persistent networks")}, - {"transient", VSH_OT_BOOL, 0, N_("list transient networks")}, - {"autostart", VSH_OT_BOOL, 0, N_("list networks with autostart enabled")}, - {"no-autostart", VSH_OT_BOOL, 0, N_("list networks with autostart disabled")}, - {NULL, 0, 0, NULL} + {.name = "inactive", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("list inactive networks") + }, + {.name = "all", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("list inactive & active networks") + }, + {.name = "persistent", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("list persistent networks") + }, + {.name = "transient", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("list transient networks") + }, + {.name = "autostart", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("list networks with autostart enabled") + }, + {.name = "no-autostart", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("list networks with autostart disabled") + }, + {.name = NULL} }; static bool @@ -650,8 +706,12 @@ static const vshCmdInfo info_network_name[] = { }; static const vshCmdOptDef opts_network_name[] = { - {"network", VSH_OT_DATA, VSH_OFLAG_REQ, N_("network uuid")}, - {NULL, 0, 0, NULL} + {.name = "network", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("network uuid") + }, + {.name = NULL} }; static bool @@ -678,8 +738,12 @@ static const vshCmdInfo info_network_start[] = { }; static const vshCmdOptDef opts_network_start[] = { - {"network", VSH_OT_DATA, VSH_OFLAG_REQ, N_("network name or uuid")}, - {NULL, 0, 0, NULL} + {.name = "network", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("network name or uuid") + }, + {.name = NULL} }; static bool @@ -712,8 +776,12 @@ static const vshCmdInfo info_network_undefine[] = { }; static const vshCmdOptDef opts_network_undefine[] = { - {"network", VSH_OT_DATA, VSH_OFLAG_REQ, N_("network name or uuid")}, - {NULL, 0, 0, NULL} + {.name = "network", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("network name or uuid") + }, + {.name = NULL} }; static bool @@ -747,19 +815,48 @@ static const vshCmdInfo info_network_update[] = { }; static const vshCmdOptDef opts_network_update[] = { - {"network", VSH_OT_DATA, VSH_OFLAG_REQ, N_("network name or uuid")}, - {"command", VSH_OT_DATA, VSH_OFLAG_REQ, - N_("type of update (add-first, add-last (add), delete, or modify)")}, - {"section", VSH_OT_DATA, VSH_OFLAG_REQ, - N_("which section of network configuration to update")}, - {"xml", VSH_OT_DATA, VSH_OFLAG_REQ, - N_("name of file containing xml (or, if it starts with '<', the complete " - "xml element itself) to add/modify, or to be matched for search")}, - {"parent-index", VSH_OT_INT, 0, N_("which parent object to search through")}, - {"config", VSH_OT_BOOL, 0, N_("affect next network startup")}, - {"live", VSH_OT_BOOL, 0, N_("affect running network")}, - {"current", VSH_OT_BOOL, 0, N_("affect current state of network")}, - {NULL, 0, 0, NULL} + {.name = "network", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("network name or uuid") + }, + {.name = "command", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("type of update (add-first, add-last (add), delete, or modify)") + }, + {.name = "section", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("which section of network configuration to update") + }, + {.name = "xml", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("name of file containing xml (or, if it starts with '<', the complete " + "xml element itself) to add/modify, or to be matched for search") + }, + {.name = "parent-index", + .type = VSH_OT_INT, + .flags = 0, + .help = N_("which parent object to search through") + }, + {.name = "config", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("affect next network startup") + }, + {.name = "live", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("affect running network") + }, + {.name = "current", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("affect current state of network") + }, + {.name = NULL} }; VIR_ENUM_DECL(virNetworkUpdateCommand) @@ -901,8 +998,12 @@ static const vshCmdInfo info_network_uuid[] = { }; static const vshCmdOptDef opts_network_uuid[] = { - {"network", VSH_OT_DATA, VSH_OFLAG_REQ, N_("network name")}, - {NULL, 0, 0, NULL} + {.name = "network", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("network name") + }, + {.name = NULL} }; static bool @@ -934,8 +1035,12 @@ static const vshCmdInfo info_network_edit[] = { }; static const vshCmdOptDef opts_network_edit[] = { - {"network", VSH_OT_DATA, VSH_OFLAG_REQ, N_("network name or uuid")}, - {NULL, 0, 0, NULL} + {.name = "network", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("network name or uuid") + }, + {.name = NULL} }; static char *vshNetworkGetXMLDesc(virNetworkPtr network) -- 1.8.0.2

On 01/14/2013 11:59 PM, Michal Privoznik wrote:
--- tools/virsh-network.c | 193 ++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 149 insertions(+), 44 deletions(-)
diff --git a/tools/virsh-network.c b/tools/virsh-network.c index fc73a28..9ba3ca8 100644 --- a/tools/virsh-network.c +++ b/tools/virsh-network.c
ACK with these change I am wondering why some structure didn't be touched. probably only option related structure. For example: /* * "net-autostart" command */ static const vshCmdInfo info_network_autostart[] = { {"help", N_("autostart a network")}, {"desc", N_("Configure a network to be automatically started at boot.")}, {NULL, NULL} };

--- tools/virsh-nodedev.c | 64 +++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 47 insertions(+), 17 deletions(-) diff --git a/tools/virsh-nodedev.c b/tools/virsh-nodedev.c index f9517cc..11135ab 100644 --- a/tools/virsh-nodedev.c +++ b/tools/virsh-nodedev.c @@ -51,9 +51,12 @@ static const vshCmdInfo info_node_device_create[] = { }; static const vshCmdOptDef opts_node_device_create[] = { - {"file", VSH_OT_DATA, VSH_OFLAG_REQ, - N_("file containing an XML description of the device")}, - {NULL, 0, 0, NULL} + {.name = "file", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("file containing an XML description of the device") + }, + {.name = NULL} }; static bool @@ -97,9 +100,12 @@ static const vshCmdInfo info_node_device_destroy[] = { }; static const vshCmdOptDef opts_node_device_destroy[] = { - {"name", VSH_OT_DATA, VSH_OFLAG_REQ, - N_("name of the device to be destroyed")}, - {NULL, 0, 0, NULL} + {.name = "name", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("name of the device to be destroyed") + }, + {.name = NULL} }; static bool @@ -330,9 +336,17 @@ static const vshCmdInfo info_node_list_devices[] = { }; static const vshCmdOptDef opts_node_list_devices[] = { - {"tree", VSH_OT_BOOL, 0, N_("list devices in a tree")}, - {"cap", VSH_OT_STRING, VSH_OFLAG_NONE, N_("capability names, separated by comma")}, - {NULL, 0, 0, NULL} + {.name = "tree", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("list devices in a tree") + }, + {.name = "cap", + .type = VSH_OT_STRING, + .flags = VSH_OFLAG_NONE, + .help = N_("capability names, separated by comma") + }, + {.name = NULL} }; static bool @@ -459,8 +473,12 @@ static const vshCmdInfo info_node_device_dumpxml[] = { static const vshCmdOptDef opts_node_device_dumpxml[] = { - {"device", VSH_OT_DATA, VSH_OFLAG_REQ, N_("device key")}, - {NULL, 0, 0, NULL} + {.name = "device", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("device key") + }, + {.name = NULL} }; static bool @@ -500,8 +518,12 @@ static const vshCmdInfo info_node_device_detach[] = { static const vshCmdOptDef opts_node_device_detach[] = { - {"device", VSH_OT_DATA, VSH_OFLAG_REQ, N_("device key")}, - {NULL, 0, 0, NULL} + {.name = "device", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("device key") + }, + {.name = NULL} }; static bool @@ -541,8 +563,12 @@ static const vshCmdInfo info_node_device_reattach[] = { static const vshCmdOptDef opts_node_device_reattach[] = { - {"device", VSH_OT_DATA, VSH_OFLAG_REQ, N_("device key")}, - {NULL, 0, 0, NULL} + {.name = "device", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("device key") + }, + {.name = NULL} }; static bool @@ -580,8 +606,12 @@ static const vshCmdInfo info_node_device_reset[] = { static const vshCmdOptDef opts_node_device_reset[] = { - {"device", VSH_OT_DATA, VSH_OFLAG_REQ, N_("device key")}, - {NULL, 0, 0, NULL} + {.name = "device", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("device key") + }, + {.name = NULL} }; static bool -- 1.8.0.2

On 01/14/2013 11:59 PM, Michal Privoznik wrote:
--- tools/virsh-nodedev.c | 64 +++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 47 insertions(+), 17 deletions(-)
diff --git a/tools/virsh-nodedev.c b/tools/virsh-nodedev.c index f9517cc..11135ab 100644 --- a/tools/virsh-nodedev.c +++ b/tools/virsh-nodedev.c @@ -51,9 +51,12 @@ static const vshCmdInfo info_node_device_create[] = { };
static const vshCmdOptDef opts_node_device_create[] = { - {"file", VSH_OT_DATA, VSH_OFLAG_REQ, - N_("file containing an XML description of the device")}, - {NULL, 0, 0, NULL} + {.name = "file", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("file containing an XML description of the device") + }, + {.name = NULL} };
static bool @@ -97,9 +100,12 @@ static const vshCmdInfo info_node_device_destroy[] = { };
static const vshCmdOptDef opts_node_device_destroy[] = { - {"name", VSH_OT_DATA, VSH_OFLAG_REQ, - N_("name of the device to be destroyed")}, - {NULL, 0, 0, NULL} + {.name = "name", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("name of the device to be destroyed") + }, + {.name = NULL} };
static bool @@ -330,9 +336,17 @@ static const vshCmdInfo info_node_list_devices[] = { };
static const vshCmdOptDef opts_node_list_devices[] = { - {"tree", VSH_OT_BOOL, 0, N_("list devices in a tree")}, - {"cap", VSH_OT_STRING, VSH_OFLAG_NONE, N_("capability names, separated by comma")}, - {NULL, 0, 0, NULL} + {.name = "tree", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("list devices in a tree") + }, + {.name = "cap", + .type = VSH_OT_STRING, + .flags = VSH_OFLAG_NONE, + .help = N_("capability names, separated by comma") + }, + {.name = NULL} };
static bool @@ -459,8 +473,12 @@ static const vshCmdInfo info_node_device_dumpxml[] = {
static const vshCmdOptDef opts_node_device_dumpxml[] = { - {"device", VSH_OT_DATA, VSH_OFLAG_REQ, N_("device key")}, - {NULL, 0, 0, NULL} + {.name = "device", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("device key") + }, + {.name = NULL} };
static bool @@ -500,8 +518,12 @@ static const vshCmdInfo info_node_device_detach[] = {
static const vshCmdOptDef opts_node_device_detach[] = { - {"device", VSH_OT_DATA, VSH_OFLAG_REQ, N_("device key")}, - {NULL, 0, 0, NULL} + {.name = "device", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("device key") + }, + {.name = NULL} };
static bool @@ -541,8 +563,12 @@ static const vshCmdInfo info_node_device_reattach[] = {
static const vshCmdOptDef opts_node_device_reattach[] = { - {"device", VSH_OT_DATA, VSH_OFLAG_REQ, N_("device key")}, - {NULL, 0, 0, NULL} + {.name = "device", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("device key") + }, + {.name = NULL} };
static bool @@ -580,8 +606,12 @@ static const vshCmdInfo info_node_device_reset[] = {
static const vshCmdOptDef opts_node_device_reset[] = { - {"device", VSH_OT_DATA, VSH_OFLAG_REQ, N_("device key")}, - {NULL, 0, 0, NULL} + {.name = "device", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("device key") + }, + {.name = NULL} };
static bool
ACK

--- tools/virsh-nwfilter.c | 34 +++++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/tools/virsh-nwfilter.c b/tools/virsh-nwfilter.c index 9341ea7..61ec34c 100644 --- a/tools/virsh-nwfilter.c +++ b/tools/virsh-nwfilter.c @@ -87,8 +87,12 @@ static const vshCmdInfo info_nwfilter_define[] = { }; static const vshCmdOptDef opts_nwfilter_define[] = { - {"file", VSH_OT_DATA, VSH_OFLAG_REQ, N_("file containing an XML network filter description")}, - {NULL, 0, 0, NULL} + {.name = "file", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("file containing an XML network filter description") + }, + {.name = NULL} }; static bool @@ -129,8 +133,12 @@ static const vshCmdInfo info_nwfilter_undefine[] = { }; static const vshCmdOptDef opts_nwfilter_undefine[] = { - {"nwfilter", VSH_OT_DATA, VSH_OFLAG_REQ, N_("network filter name or uuid")}, - {NULL, 0, 0, NULL} + {.name = "nwfilter", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("network filter name or uuid") + }, + {.name = NULL} }; static bool @@ -164,8 +172,12 @@ static const vshCmdInfo info_nwfilter_dumpxml[] = { }; static const vshCmdOptDef opts_nwfilter_dumpxml[] = { - {"nwfilter", VSH_OT_DATA, VSH_OFLAG_REQ, N_("network filter name or uuid")}, - {NULL, 0, 0, NULL} + {.name = "nwfilter", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("network filter name or uuid") + }, + {.name = NULL} }; static bool @@ -328,7 +340,7 @@ static const vshCmdInfo info_nwfilter_list[] = { }; static const vshCmdOptDef opts_nwfilter_list[] = { - {NULL, 0, 0, NULL} + {.name = NULL} }; static bool @@ -368,8 +380,12 @@ static const vshCmdInfo info_nwfilter_edit[] = { }; static const vshCmdOptDef opts_nwfilter_edit[] = { - {"nwfilter", VSH_OT_DATA, VSH_OFLAG_REQ, N_("network filter name or uuid")}, - {NULL, 0, 0, NULL} + {.name = "nwfilter", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("network filter name or uuid") + }, + {.name = NULL} }; static bool -- 1.8.0.2

On 01/14/2013 11:59 PM, Michal Privoznik wrote:
--- tools/virsh-nwfilter.c | 34 +++++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 9 deletions(-)
diff --git a/tools/virsh-nwfilter.c b/tools/virsh-nwfilter.c index 9341ea7..61ec34c 100644 --- a/tools/virsh-nwfilter.c +++ b/tools/virsh-nwfilter.c @@ -87,8 +87,12 @@ static const vshCmdInfo info_nwfilter_define[] = { };
static const vshCmdOptDef opts_nwfilter_define[] = { - {"file", VSH_OT_DATA, VSH_OFLAG_REQ, N_("file containing an XML network filter description")}, - {NULL, 0, 0, NULL} + {.name = "file", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("file containing an XML network filter description") + }, + {.name = NULL} };
static bool @@ -129,8 +133,12 @@ static const vshCmdInfo info_nwfilter_undefine[] = { };
static const vshCmdOptDef opts_nwfilter_undefine[] = { - {"nwfilter", VSH_OT_DATA, VSH_OFLAG_REQ, N_("network filter name or uuid")}, - {NULL, 0, 0, NULL} + {.name = "nwfilter", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("network filter name or uuid") + }, + {.name = NULL} };
static bool @@ -164,8 +172,12 @@ static const vshCmdInfo info_nwfilter_dumpxml[] = { };
static const vshCmdOptDef opts_nwfilter_dumpxml[] = { - {"nwfilter", VSH_OT_DATA, VSH_OFLAG_REQ, N_("network filter name or uuid")}, - {NULL, 0, 0, NULL} + {.name = "nwfilter", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("network filter name or uuid") + }, + {.name = NULL} };
static bool @@ -328,7 +340,7 @@ static const vshCmdInfo info_nwfilter_list[] = { };
static const vshCmdOptDef opts_nwfilter_list[] = { - {NULL, 0, 0, NULL} + {.name = NULL} };
static bool @@ -368,8 +380,12 @@ static const vshCmdInfo info_nwfilter_edit[] = { };
static const vshCmdOptDef opts_nwfilter_edit[] = { - {"nwfilter", VSH_OT_DATA, VSH_OFLAG_REQ, N_("network filter name or uuid")}, - {NULL, 0, 0, NULL} + {.name = "nwfilter", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("network filter name or uuid") + }, + {.name = NULL} };
static bool
ACK.

--- tools/virsh-pool.c | 286 +++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 223 insertions(+), 63 deletions(-) diff --git a/tools/virsh-pool.c b/tools/virsh-pool.c index adac7f1..cb9866f 100644 --- a/tools/virsh-pool.c +++ b/tools/virsh-pool.c @@ -85,9 +85,17 @@ static const vshCmdInfo info_pool_autostart[] = { }; static const vshCmdOptDef opts_pool_autostart[] = { - {"pool", VSH_OT_DATA, VSH_OFLAG_REQ, N_("pool name or uuid")}, - {"disable", VSH_OT_BOOL, 0, N_("disable autostarting")}, - {NULL, 0, 0, NULL} + {.name = "pool", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("pool name or uuid") + }, + {.name = "disable", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("disable autostarting") + }, + {.name = NULL} }; static bool @@ -130,9 +138,12 @@ static const vshCmdInfo info_pool_create[] = { }; static const vshCmdOptDef opts_pool_create[] = { - {"file", VSH_OT_DATA, VSH_OFLAG_REQ, - N_("file containing an XML pool description")}, - {NULL, 0, 0, NULL} + {.name = "file", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("file containing an XML pool description") + }, + {.name = NULL} }; static bool @@ -167,16 +178,52 @@ cmdPoolCreate(vshControl *ctl, const vshCmd *cmd) * XML Building helper for pool-define-as and pool-create-as */ static const vshCmdOptDef opts_pool_X_as[] = { - {"name", VSH_OT_DATA, VSH_OFLAG_REQ, N_("name of the pool")}, - {"print-xml", VSH_OT_BOOL, 0, N_("print XML document, but don't define/create")}, - {"type", VSH_OT_DATA, VSH_OFLAG_REQ, N_("type of the pool")}, - {"source-host", VSH_OT_DATA, 0, N_("source-host for underlying storage")}, - {"source-path", VSH_OT_DATA, 0, N_("source path for underlying storage")}, - {"source-dev", VSH_OT_DATA, 0, N_("source device for underlying storage")}, - {"source-name", VSH_OT_DATA, 0, N_("source name for underlying storage")}, - {"target", VSH_OT_DATA, 0, N_("target for underlying storage")}, - {"source-format", VSH_OT_STRING, 0, N_("format for underlying storage")}, - {NULL, 0, 0, NULL} + {.name = "name", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("name of the pool") + }, + {.name = "print-xml", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("print XML document, but don't define/create") + }, + {.name = "type", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("type of the pool") + }, + {.name = "source-host", + .type = VSH_OT_DATA, + .flags = 0, + .help = N_("source-host for underlying storage") + }, + {.name = "source-path", + .type = VSH_OT_DATA, + .flags = 0, + .help = N_("source path for underlying storage") + }, + {.name = "source-dev", + .type = VSH_OT_DATA, + .flags = 0, + .help = N_("source device for underlying storage") + }, + {.name = "source-name", + .type = VSH_OT_DATA, + .flags = 0, + .help = N_("source name for underlying storage") + }, + {.name = "target", + .type = VSH_OT_DATA, + .flags = 0, + .help = N_("target for underlying storage") + }, + {.name = "source-format", + .type = VSH_OT_STRING, + .flags = 0, + .help = N_("format for underlying storage") + }, + {.name = NULL} }; static int buildPoolXML(const vshCmd *cmd, const char **retname, char **xml) { @@ -287,8 +334,12 @@ static const vshCmdInfo info_pool_define[] = { }; static const vshCmdOptDef opts_pool_define[] = { - {"file", VSH_OT_DATA, VSH_OFLAG_REQ, N_("file containing an XML pool description")}, - {NULL, 0, 0, NULL} + {.name = "file", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("file containing an XML pool description") + }, + {.name = NULL} }; static bool @@ -367,10 +418,22 @@ static const vshCmdInfo info_pool_build[] = { }; static const vshCmdOptDef opts_pool_build[] = { - {"pool", VSH_OT_DATA, VSH_OFLAG_REQ, N_("pool name or uuid")}, - {"no-overwrite", VSH_OT_BOOL, 0, N_("do not overwrite an existing pool of this type")}, - {"overwrite", VSH_OT_BOOL, 0, N_("overwrite any existing data")}, - {NULL, 0, 0, NULL} + {.name = "pool", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("pool name or uuid") + }, + {.name = "no-overwrite", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("do not overwrite an existing pool of this type") + }, + {.name = "overwrite", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("overwrite any existing data") + }, + {.name = NULL} }; static bool @@ -415,8 +478,12 @@ static const vshCmdInfo info_pool_destroy[] = { }; static const vshCmdOptDef opts_pool_destroy[] = { - {"pool", VSH_OT_DATA, VSH_OFLAG_REQ, N_("pool name or uuid")}, - {NULL, 0, 0, NULL} + {.name = "pool", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("pool name or uuid") + }, + {.name = NULL} }; static bool @@ -450,8 +517,12 @@ static const vshCmdInfo info_pool_delete[] = { }; static const vshCmdOptDef opts_pool_delete[] = { - {"pool", VSH_OT_DATA, VSH_OFLAG_REQ, N_("pool name or uuid")}, - {NULL, 0, 0, NULL} + {.name = "pool", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("pool name or uuid") + }, + {.name = NULL} }; static bool @@ -485,8 +556,12 @@ static const vshCmdInfo info_pool_refresh[] = { }; static const vshCmdOptDef opts_pool_refresh[] = { - {"pool", VSH_OT_DATA, VSH_OFLAG_REQ, N_("pool name or uuid")}, - {NULL, 0, 0, NULL} + {.name = "pool", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("pool name or uuid") + }, + {.name = NULL} }; static bool @@ -520,9 +595,17 @@ static const vshCmdInfo info_pool_dumpxml[] = { }; static const vshCmdOptDef opts_pool_dumpxml[] = { - {"pool", VSH_OT_DATA, VSH_OFLAG_REQ, N_("pool name or uuid")}, - {"inactive", VSH_OT_BOOL, 0, N_("show inactive defined XML")}, - {NULL, 0, 0, NULL} + {.name = "pool", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("pool name or uuid") + }, + {.name = "inactive", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("show inactive defined XML") + }, + {.name = NULL} }; static bool @@ -786,15 +869,47 @@ static const vshCmdInfo info_pool_list[] = { }; static const vshCmdOptDef opts_pool_list[] = { - {"inactive", VSH_OT_BOOL, 0, N_("list inactive pools")}, - {"all", VSH_OT_BOOL, 0, N_("list inactive & active pools")}, - {"transient", VSH_OT_BOOL, 0, N_("list transient pools")}, - {"persistent", VSH_OT_BOOL, 0, N_("list persistent pools")}, - {"autostart", VSH_OT_BOOL, 0, N_("list pools with autostart enabled")}, - {"no-autostart", VSH_OT_BOOL, 0, N_("list pools with autostart disabled")}, - {"type", VSH_OT_STRING, 0, N_("only list pool of specified type(s) (if supported)")}, - {"details", VSH_OT_BOOL, 0, N_("display extended details for pools")}, - {NULL, 0, 0, NULL} + {.name = "inactive", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("list inactive pools") + }, + {.name = "all", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("list inactive & active pools") + }, + {.name = "transient", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("list transient pools") + }, + {.name = "persistent", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("list persistent pools") + }, + {.name = "autostart", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("list pools with autostart enabled") + }, + {.name = "no-autostart", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("list pools with autostart disabled") + }, + {.name = "type", + .type = VSH_OT_STRING, + .flags = 0, + .help = N_("only list pool of specified type(s) (if supported)") + }, + {.name = "details", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("display extended details for pools") + }, + {.name = NULL} }; static bool @@ -1206,12 +1321,27 @@ static const vshCmdInfo info_find_storage_pool_sources_as[] = { }; static const vshCmdOptDef opts_find_storage_pool_sources_as[] = { - {"type", VSH_OT_DATA, VSH_OFLAG_REQ, - N_("type of storage pool sources to find")}, - {"host", VSH_OT_DATA, VSH_OFLAG_NONE, N_("optional host to query")}, - {"port", VSH_OT_DATA, VSH_OFLAG_NONE, N_("optional port to query")}, - {"initiator", VSH_OT_DATA, VSH_OFLAG_NONE, N_("optional initiator IQN to use for query")}, - {NULL, 0, 0, NULL} + {.name = "type", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("type of storage pool sources to find") + }, + {.name = "host", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_NONE, + .help = N_("optional host to query") + }, + {.name = "port", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_NONE, + .help = N_("optional port to query") + }, + {.name = "initiator", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_NONE, + .help = N_("optional initiator IQN to use for query") + }, + {.name = NULL} }; static bool @@ -1278,11 +1408,17 @@ static const vshCmdInfo info_find_storage_pool_sources[] = { }; static const vshCmdOptDef opts_find_storage_pool_sources[] = { - {"type", VSH_OT_DATA, VSH_OFLAG_REQ, - N_("type of storage pool sources to discover")}, - {"srcSpec", VSH_OT_DATA, VSH_OFLAG_NONE, - N_("optional file of source xml to query for pools")}, - {NULL, 0, 0, NULL} + {.name = "type", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("type of storage pool sources to discover") + }, + {.name = "srcSpec", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_NONE, + .help = N_("optional file of source xml to query for pools") + }, + {.name = NULL} }; static bool @@ -1325,8 +1461,12 @@ static const vshCmdInfo info_pool_info[] = { }; static const vshCmdOptDef opts_pool_info[] = { - {"pool", VSH_OT_DATA, VSH_OFLAG_REQ, N_("pool name or uuid")}, - {NULL, 0, 0, NULL} + {.name = "pool", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("pool name or uuid") + }, + {.name = NULL} }; static bool @@ -1417,8 +1557,12 @@ static const vshCmdInfo info_pool_name[] = { }; static const vshCmdOptDef opts_pool_name[] = { - {"pool", VSH_OT_DATA, VSH_OFLAG_REQ, N_("pool uuid")}, - {NULL, 0, 0, NULL} + {.name = "pool", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("pool uuid") + }, + {.name = NULL} }; static bool @@ -1445,8 +1589,12 @@ static const vshCmdInfo info_pool_start[] = { }; static const vshCmdOptDef opts_pool_start[] = { - {"pool", VSH_OT_DATA, VSH_OFLAG_REQ, N_("name or uuid of the inactive pool")}, - {NULL, 0, 0, NULL} + {.name = "pool", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("name or uuid of the inactive pool") + }, + {.name = NULL} }; static bool @@ -1480,8 +1628,12 @@ static const vshCmdInfo info_pool_undefine[] = { }; static const vshCmdOptDef opts_pool_undefine[] = { - {"pool", VSH_OT_DATA, VSH_OFLAG_REQ, N_("pool name or uuid")}, - {NULL, 0, 0, NULL} + {.name = "pool", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("pool name or uuid") + }, + {.name = NULL} }; static bool @@ -1515,8 +1667,12 @@ static const vshCmdInfo info_pool_uuid[] = { }; static const vshCmdOptDef opts_pool_uuid[] = { - {"pool", VSH_OT_DATA, VSH_OFLAG_REQ, N_("pool name")}, - {NULL, 0, 0, NULL} + {.name = "pool", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("pool name") + }, + {.name = NULL} }; static bool @@ -1548,8 +1704,12 @@ static const vshCmdInfo info_pool_edit[] = { }; static const vshCmdOptDef opts_pool_edit[] = { - {"pool", VSH_OT_DATA, VSH_OFLAG_REQ, N_("pool name or uuid")}, - {NULL, 0, 0, NULL} + {.name = "pool", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("pool name or uuid") + }, + {.name = NULL} }; static bool -- 1.8.0.2

On 01/14/2013 11:59 PM, Michal Privoznik wrote:
--- tools/virsh-pool.c | 286 +++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 223 insertions(+), 63 deletions(-)
diff --git a/tools/virsh-pool.c b/tools/virsh-pool.c index adac7f1..cb9866f 100644 --- a/tools/virsh-pool.c +++ b/tools/virsh-pool.c @@ -85,9 +85,17 @@ static const vshCmdInfo info_pool_autostart[] = { };
static const vshCmdOptDef opts_pool_autostart[] = { - {"pool", VSH_OT_DATA, VSH_OFLAG_REQ, N_("pool name or uuid")}, - {"disable", VSH_OT_BOOL, 0, N_("disable autostarting")}, - {NULL, 0, 0, NULL} + {.name = "pool", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("pool name or uuid") + }, + {.name = "disable", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("disable autostarting") + }, + {.name = NULL} };
static bool @@ -130,9 +138,12 @@ static const vshCmdInfo info_pool_create[] = { };
static const vshCmdOptDef opts_pool_create[] = { - {"file", VSH_OT_DATA, VSH_OFLAG_REQ, - N_("file containing an XML pool description")}, - {NULL, 0, 0, NULL} + {.name = "file", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("file containing an XML pool description") + }, + {.name = NULL} };
static bool @@ -167,16 +178,52 @@ cmdPoolCreate(vshControl *ctl, const vshCmd *cmd) * XML Building helper for pool-define-as and pool-create-as */ static const vshCmdOptDef opts_pool_X_as[] = { - {"name", VSH_OT_DATA, VSH_OFLAG_REQ, N_("name of the pool")}, - {"print-xml", VSH_OT_BOOL, 0, N_("print XML document, but don't define/create")}, - {"type", VSH_OT_DATA, VSH_OFLAG_REQ, N_("type of the pool")}, - {"source-host", VSH_OT_DATA, 0, N_("source-host for underlying storage")}, - {"source-path", VSH_OT_DATA, 0, N_("source path for underlying storage")}, - {"source-dev", VSH_OT_DATA, 0, N_("source device for underlying storage")}, - {"source-name", VSH_OT_DATA, 0, N_("source name for underlying storage")}, - {"target", VSH_OT_DATA, 0, N_("target for underlying storage")}, - {"source-format", VSH_OT_STRING, 0, N_("format for underlying storage")}, - {NULL, 0, 0, NULL} + {.name = "name", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("name of the pool") + }, + {.name = "print-xml", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("print XML document, but don't define/create") + }, + {.name = "type", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("type of the pool") + }, + {.name = "source-host", + .type = VSH_OT_DATA, + .flags = 0, + .help = N_("source-host for underlying storage") + }, + {.name = "source-path", + .type = VSH_OT_DATA, + .flags = 0, + .help = N_("source path for underlying storage") + }, + {.name = "source-dev", + .type = VSH_OT_DATA, + .flags = 0, + .help = N_("source device for underlying storage") + }, + {.name = "source-name", + .type = VSH_OT_DATA, + .flags = 0, + .help = N_("source name for underlying storage") + }, + {.name = "target", + .type = VSH_OT_DATA, + .flags = 0, + .help = N_("target for underlying storage") + }, + {.name = "source-format", + .type = VSH_OT_STRING, + .flags = 0, + .help = N_("format for underlying storage") + }, + {.name = NULL} };
static int buildPoolXML(const vshCmd *cmd, const char **retname, char **xml) { @@ -287,8 +334,12 @@ static const vshCmdInfo info_pool_define[] = { };
static const vshCmdOptDef opts_pool_define[] = { - {"file", VSH_OT_DATA, VSH_OFLAG_REQ, N_("file containing an XML pool description")}, - {NULL, 0, 0, NULL} + {.name = "file", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("file containing an XML pool description") + }, + {.name = NULL} };
static bool @@ -367,10 +418,22 @@ static const vshCmdInfo info_pool_build[] = { };
static const vshCmdOptDef opts_pool_build[] = { - {"pool", VSH_OT_DATA, VSH_OFLAG_REQ, N_("pool name or uuid")}, - {"no-overwrite", VSH_OT_BOOL, 0, N_("do not overwrite an existing pool of this type")}, - {"overwrite", VSH_OT_BOOL, 0, N_("overwrite any existing data")}, - {NULL, 0, 0, NULL} + {.name = "pool", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("pool name or uuid") + }, + {.name = "no-overwrite", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("do not overwrite an existing pool of this type") + }, + {.name = "overwrite", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("overwrite any existing data") + }, + {.name = NULL} };
static bool @@ -415,8 +478,12 @@ static const vshCmdInfo info_pool_destroy[] = { };
static const vshCmdOptDef opts_pool_destroy[] = { - {"pool", VSH_OT_DATA, VSH_OFLAG_REQ, N_("pool name or uuid")}, - {NULL, 0, 0, NULL} + {.name = "pool", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("pool name or uuid") + }, + {.name = NULL} };
static bool @@ -450,8 +517,12 @@ static const vshCmdInfo info_pool_delete[] = { };
static const vshCmdOptDef opts_pool_delete[] = { - {"pool", VSH_OT_DATA, VSH_OFLAG_REQ, N_("pool name or uuid")}, - {NULL, 0, 0, NULL} + {.name = "pool", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("pool name or uuid") + }, + {.name = NULL} };
static bool @@ -485,8 +556,12 @@ static const vshCmdInfo info_pool_refresh[] = { };
static const vshCmdOptDef opts_pool_refresh[] = { - {"pool", VSH_OT_DATA, VSH_OFLAG_REQ, N_("pool name or uuid")}, - {NULL, 0, 0, NULL} + {.name = "pool", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("pool name or uuid") + }, + {.name = NULL} };
static bool @@ -520,9 +595,17 @@ static const vshCmdInfo info_pool_dumpxml[] = { };
static const vshCmdOptDef opts_pool_dumpxml[] = { - {"pool", VSH_OT_DATA, VSH_OFLAG_REQ, N_("pool name or uuid")}, - {"inactive", VSH_OT_BOOL, 0, N_("show inactive defined XML")}, - {NULL, 0, 0, NULL} + {.name = "pool", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("pool name or uuid") + }, + {.name = "inactive", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("show inactive defined XML") + }, + {.name = NULL} };
static bool @@ -786,15 +869,47 @@ static const vshCmdInfo info_pool_list[] = { };
static const vshCmdOptDef opts_pool_list[] = { - {"inactive", VSH_OT_BOOL, 0, N_("list inactive pools")}, - {"all", VSH_OT_BOOL, 0, N_("list inactive & active pools")}, - {"transient", VSH_OT_BOOL, 0, N_("list transient pools")}, - {"persistent", VSH_OT_BOOL, 0, N_("list persistent pools")}, - {"autostart", VSH_OT_BOOL, 0, N_("list pools with autostart enabled")}, - {"no-autostart", VSH_OT_BOOL, 0, N_("list pools with autostart disabled")}, - {"type", VSH_OT_STRING, 0, N_("only list pool of specified type(s) (if supported)")}, - {"details", VSH_OT_BOOL, 0, N_("display extended details for pools")}, - {NULL, 0, 0, NULL} + {.name = "inactive", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("list inactive pools") + }, + {.name = "all", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("list inactive & active pools") + }, + {.name = "transient", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("list transient pools") + }, + {.name = "persistent", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("list persistent pools") + }, + {.name = "autostart", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("list pools with autostart enabled") + }, + {.name = "no-autostart", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("list pools with autostart disabled") + }, + {.name = "type", + .type = VSH_OT_STRING, + .flags = 0, + .help = N_("only list pool of specified type(s) (if supported)") + }, + {.name = "details", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("display extended details for pools") + }, + {.name = NULL} };
static bool @@ -1206,12 +1321,27 @@ static const vshCmdInfo info_find_storage_pool_sources_as[] = { };
static const vshCmdOptDef opts_find_storage_pool_sources_as[] = { - {"type", VSH_OT_DATA, VSH_OFLAG_REQ, - N_("type of storage pool sources to find")}, - {"host", VSH_OT_DATA, VSH_OFLAG_NONE, N_("optional host to query")}, - {"port", VSH_OT_DATA, VSH_OFLAG_NONE, N_("optional port to query")}, - {"initiator", VSH_OT_DATA, VSH_OFLAG_NONE, N_("optional initiator IQN to use for query")}, - {NULL, 0, 0, NULL} + {.name = "type", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("type of storage pool sources to find") + }, + {.name = "host", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_NONE, + .help = N_("optional host to query") + }, + {.name = "port", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_NONE, + .help = N_("optional port to query") + }, + {.name = "initiator", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_NONE, + .help = N_("optional initiator IQN to use for query") + }, + {.name = NULL} };
static bool @@ -1278,11 +1408,17 @@ static const vshCmdInfo info_find_storage_pool_sources[] = { };
static const vshCmdOptDef opts_find_storage_pool_sources[] = { - {"type", VSH_OT_DATA, VSH_OFLAG_REQ, - N_("type of storage pool sources to discover")}, - {"srcSpec", VSH_OT_DATA, VSH_OFLAG_NONE, - N_("optional file of source xml to query for pools")}, - {NULL, 0, 0, NULL} + {.name = "type", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("type of storage pool sources to discover") + }, + {.name = "srcSpec", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_NONE, + .help = N_("optional file of source xml to query for pools") + }, + {.name = NULL} };
static bool @@ -1325,8 +1461,12 @@ static const vshCmdInfo info_pool_info[] = { };
static const vshCmdOptDef opts_pool_info[] = { - {"pool", VSH_OT_DATA, VSH_OFLAG_REQ, N_("pool name or uuid")}, - {NULL, 0, 0, NULL} + {.name = "pool", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("pool name or uuid") + }, + {.name = NULL} };
static bool @@ -1417,8 +1557,12 @@ static const vshCmdInfo info_pool_name[] = { };
static const vshCmdOptDef opts_pool_name[] = { - {"pool", VSH_OT_DATA, VSH_OFLAG_REQ, N_("pool uuid")}, - {NULL, 0, 0, NULL} + {.name = "pool", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("pool uuid") + }, + {.name = NULL} };
static bool @@ -1445,8 +1589,12 @@ static const vshCmdInfo info_pool_start[] = { };
static const vshCmdOptDef opts_pool_start[] = { - {"pool", VSH_OT_DATA, VSH_OFLAG_REQ, N_("name or uuid of the inactive pool")}, - {NULL, 0, 0, NULL} + {.name = "pool", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("name or uuid of the inactive pool") + }, + {.name = NULL} };
static bool @@ -1480,8 +1628,12 @@ static const vshCmdInfo info_pool_undefine[] = { };
static const vshCmdOptDef opts_pool_undefine[] = { - {"pool", VSH_OT_DATA, VSH_OFLAG_REQ, N_("pool name or uuid")}, - {NULL, 0, 0, NULL} + {.name = "pool", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("pool name or uuid") + }, + {.name = NULL} };
static bool @@ -1515,8 +1667,12 @@ static const vshCmdInfo info_pool_uuid[] = { };
static const vshCmdOptDef opts_pool_uuid[] = { - {"pool", VSH_OT_DATA, VSH_OFLAG_REQ, N_("pool name")}, - {NULL, 0, 0, NULL} + {.name = "pool", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("pool name") + }, + {.name = NULL} };
static bool @@ -1548,8 +1704,12 @@ static const vshCmdInfo info_pool_edit[] = { };
static const vshCmdOptDef opts_pool_edit[] = { - {"pool", VSH_OT_DATA, VSH_OFLAG_REQ, N_("pool name or uuid")}, - {NULL, 0, 0, NULL} + {.name = "pool", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("pool name or uuid") + }, + {.name = NULL} };
static bool
ACK.

--- tools/virsh-secret.c | 72 ++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 56 insertions(+), 16 deletions(-) diff --git a/tools/virsh-secret.c b/tools/virsh-secret.c index 8297743..05bab85 100644 --- a/tools/virsh-secret.c +++ b/tools/virsh-secret.c @@ -75,8 +75,12 @@ static const vshCmdInfo info_secret_define[] = { }; static const vshCmdOptDef opts_secret_define[] = { - {"file", VSH_OT_DATA, VSH_OFLAG_REQ, N_("file containing secret attributes in XML")}, - {NULL, 0, 0, NULL} + {.name = "file", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("file containing secret attributes in XML") + }, + {.name = NULL} }; static bool @@ -120,8 +124,12 @@ static const vshCmdInfo info_secret_dumpxml[] = { }; static const vshCmdOptDef opts_secret_dumpxml[] = { - {"secret", VSH_OT_DATA, VSH_OFLAG_REQ, N_("secret UUID")}, - {NULL, 0, 0, NULL} + {.name = "secret", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("secret UUID") + }, + {.name = NULL} }; static bool @@ -157,9 +165,17 @@ static const vshCmdInfo info_secret_set_value[] = { }; static const vshCmdOptDef opts_secret_set_value[] = { - {"secret", VSH_OT_DATA, VSH_OFLAG_REQ, N_("secret UUID")}, - {"base64", VSH_OT_DATA, VSH_OFLAG_REQ, N_("base64-encoded secret value")}, - {NULL, 0, 0, NULL} + {.name = "secret", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("secret UUID") + }, + {.name = "base64", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("base64-encoded secret value") + }, + {.name = NULL} }; static bool @@ -214,8 +230,12 @@ static const vshCmdInfo info_secret_get_value[] = { }; static const vshCmdOptDef opts_secret_get_value[] = { - {"secret", VSH_OT_DATA, VSH_OFLAG_REQ, N_("secret UUID")}, - {NULL, 0, 0, NULL} + {.name = "secret", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("secret UUID") + }, + {.name = NULL} }; static bool @@ -263,8 +283,12 @@ static const vshCmdInfo info_secret_undefine[] = { }; static const vshCmdOptDef opts_secret_undefine[] = { - {"secret", VSH_OT_DATA, VSH_OFLAG_REQ, N_("secret UUID")}, - {NULL, 0, 0, NULL} + {.name = "secret", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("secret UUID") + }, + {.name = NULL} }; static bool @@ -435,11 +459,27 @@ static const vshCmdInfo info_secret_list[] = { }; static const vshCmdOptDef opts_secret_list[] = { - {"ephemeral", VSH_OT_BOOL, 0, N_("list ephemeral secrets")}, - {"no-ephemeral", VSH_OT_BOOL, 0, N_("list non-ephemeral secrets")}, - {"private", VSH_OT_BOOL, 0, N_("list private secrets")}, - {"no-private", VSH_OT_BOOL, 0, N_("list non-private secrets")}, - {NULL, 0, 0, NULL} + {.name = "ephemeral", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("list ephemeral secrets") + }, + {.name = "no-ephemeral", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("list non-ephemeral secrets") + }, + {.name = "private", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("list private secrets") + }, + {.name = "no-private", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("list non-private secrets") + }, + {.name = NULL} }; static bool -- 1.8.0.2

On 01/14/2013 11:59 PM, Michal Privoznik wrote:
--- tools/virsh-secret.c | 72 ++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 56 insertions(+), 16 deletions(-)
diff --git a/tools/virsh-secret.c b/tools/virsh-secret.c index 8297743..05bab85 100644 --- a/tools/virsh-secret.c +++ b/tools/virsh-secret.c @@ -75,8 +75,12 @@ static const vshCmdInfo info_secret_define[] = { };
static const vshCmdOptDef opts_secret_define[] = { - {"file", VSH_OT_DATA, VSH_OFLAG_REQ, N_("file containing secret attributes in XML")}, - {NULL, 0, 0, NULL} + {.name = "file", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("file containing secret attributes in XML") + }, + {.name = NULL} };
static bool @@ -120,8 +124,12 @@ static const vshCmdInfo info_secret_dumpxml[] = { };
static const vshCmdOptDef opts_secret_dumpxml[] = { - {"secret", VSH_OT_DATA, VSH_OFLAG_REQ, N_("secret UUID")}, - {NULL, 0, 0, NULL} + {.name = "secret", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("secret UUID") + }, + {.name = NULL} };
static bool @@ -157,9 +165,17 @@ static const vshCmdInfo info_secret_set_value[] = { };
static const vshCmdOptDef opts_secret_set_value[] = { - {"secret", VSH_OT_DATA, VSH_OFLAG_REQ, N_("secret UUID")}, - {"base64", VSH_OT_DATA, VSH_OFLAG_REQ, N_("base64-encoded secret value")}, - {NULL, 0, 0, NULL} + {.name = "secret", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("secret UUID") + }, + {.name = "base64", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("base64-encoded secret value") + }, + {.name = NULL} };
static bool @@ -214,8 +230,12 @@ static const vshCmdInfo info_secret_get_value[] = { };
static const vshCmdOptDef opts_secret_get_value[] = { - {"secret", VSH_OT_DATA, VSH_OFLAG_REQ, N_("secret UUID")}, - {NULL, 0, 0, NULL} + {.name = "secret", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("secret UUID") + }, + {.name = NULL} };
static bool @@ -263,8 +283,12 @@ static const vshCmdInfo info_secret_undefine[] = { };
static const vshCmdOptDef opts_secret_undefine[] = { - {"secret", VSH_OT_DATA, VSH_OFLAG_REQ, N_("secret UUID")}, - {NULL, 0, 0, NULL} + {.name = "secret", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("secret UUID") + }, + {.name = NULL} };
static bool @@ -435,11 +459,27 @@ static const vshCmdInfo info_secret_list[] = { };
static const vshCmdOptDef opts_secret_list[] = { - {"ephemeral", VSH_OT_BOOL, 0, N_("list ephemeral secrets")}, - {"no-ephemeral", VSH_OT_BOOL, 0, N_("list non-ephemeral secrets")}, - {"private", VSH_OT_BOOL, 0, N_("list private secrets")}, - {"no-private", VSH_OT_BOOL, 0, N_("list non-private secrets")}, - {NULL, 0, 0, NULL} + {.name = "ephemeral", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("list ephemeral secrets") + }, + {.name = "no-ephemeral", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("list non-ephemeral secrets") + }, + {.name = "private", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("list private secrets") + }, + {.name = "no-private", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("list non-private secrets") + }, + {.name = NULL} };
static bool
ACK.

--- tools/virsh-snapshot.c | 452 +++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 360 insertions(+), 92 deletions(-) diff --git a/tools/virsh-snapshot.c b/tools/virsh-snapshot.c index 3b179e2..e4745d6 100644 --- a/tools/virsh-snapshot.c +++ b/tools/virsh-snapshot.c @@ -118,18 +118,62 @@ static const vshCmdInfo info_snapshot_create[] = { }; static const vshCmdOptDef opts_snapshot_create[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"xmlfile", VSH_OT_DATA, 0, N_("domain snapshot XML")}, - {"redefine", VSH_OT_BOOL, 0, N_("redefine metadata for existing snapshot")}, - {"current", VSH_OT_BOOL, 0, N_("with redefine, set current snapshot")}, - {"no-metadata", VSH_OT_BOOL, 0, N_("take snapshot but create no metadata")}, - {"halt", VSH_OT_BOOL, 0, N_("halt domain after snapshot is created")}, - {"disk-only", VSH_OT_BOOL, 0, N_("capture disk state but not vm state")}, - {"reuse-external", VSH_OT_BOOL, 0, N_("reuse any existing external files")}, - {"quiesce", VSH_OT_BOOL, 0, N_("quiesce guest's file systems")}, - {"atomic", VSH_OT_BOOL, 0, N_("require atomic operation")}, - {"live", VSH_OT_BOOL, 0, N_("take a live snapshot")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "xmlfile", + .type = VSH_OT_DATA, + .flags = 0, + .help = N_("domain snapshot XML") + }, + {.name = "redefine", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("redefine metadata for existing snapshot") + }, + {.name = "current", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("with redefine, set current snapshot") + }, + {.name = "no-metadata", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("take snapshot but create no metadata") + }, + {.name = "halt", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("halt domain after snapshot is created") + }, + {.name = "disk-only", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("capture disk state but not vm state") + }, + {.name = "reuse-external", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("reuse any existing external files") + }, + {.name = "quiesce", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("quiesce guest's file systems") + }, + {.name = "atomic", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("require atomic operation") + }, + {.name = "live", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("take a live snapshot") + }, + {.name = NULL} }; static bool @@ -296,22 +340,72 @@ static const vshCmdInfo info_snapshot_create_as[] = { }; static const vshCmdOptDef opts_snapshot_create_as[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"name", VSH_OT_DATA, 0, N_("name of snapshot")}, - {"description", VSH_OT_DATA, 0, N_("description of snapshot")}, - {"print-xml", VSH_OT_BOOL, 0, N_("print XML document rather than create")}, - {"no-metadata", VSH_OT_BOOL, 0, N_("take snapshot but create no metadata")}, - {"halt", VSH_OT_BOOL, 0, N_("halt domain after snapshot is created")}, - {"disk-only", VSH_OT_BOOL, 0, N_("capture disk state but not vm state")}, - {"reuse-external", VSH_OT_BOOL, 0, N_("reuse any existing external files")}, - {"quiesce", VSH_OT_BOOL, 0, N_("quiesce guest's file systems")}, - {"atomic", VSH_OT_BOOL, 0, N_("require atomic operation")}, - {"live", VSH_OT_BOOL, 0, N_("take a live snapshot")}, - {"memspec", VSH_OT_DATA, VSH_OFLAG_REQ_OPT, - N_("memory attributes: [file=]name[,snapshot=type]")}, - {"diskspec", VSH_OT_ARGV, 0, - N_("disk attributes: disk[,snapshot=type][,driver=type][,file=name]")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "name", + .type = VSH_OT_DATA, + .flags = 0, + .help = N_("name of snapshot") + }, + {.name = "description", + .type = VSH_OT_DATA, + .flags = 0, + .help = N_("description of snapshot") + }, + {.name = "print-xml", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("print XML document rather than create") + }, + {.name = "no-metadata", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("take snapshot but create no metadata") + }, + {.name = "halt", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("halt domain after snapshot is created") + }, + {.name = "disk-only", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("capture disk state but not vm state") + }, + {.name = "reuse-external", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("reuse any existing external files") + }, + {.name = "quiesce", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("quiesce guest's file systems") + }, + {.name = "atomic", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("require atomic operation") + }, + {.name = "live", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("take a live snapshot") + }, + {.name = "memspec", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ_OPT, + .help = N_("memory attributes: [file=]name[,snapshot=type]") + }, + {.name = "diskspec", + .type = VSH_OT_ARGV, + .flags = 0, + .help = N_("disk attributes: disk[,snapshot=type][,driver=type][,file=name]") + }, + {.name = NULL} }; static bool @@ -448,12 +542,32 @@ static const vshCmdInfo info_snapshot_edit[] = { }; static const vshCmdOptDef opts_snapshot_edit[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"snapshotname", VSH_OT_DATA, 0, N_("snapshot name")}, - {"current", VSH_OT_BOOL, 0, N_("also set edited snapshot as current")}, - {"rename", VSH_OT_BOOL, 0, N_("allow renaming an existing snapshot")}, - {"clone", VSH_OT_BOOL, 0, N_("allow cloning to new name")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "snapshotname", + .type = VSH_OT_DATA, + .flags = 0, + .help = N_("snapshot name") + }, + {.name = "current", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("also set edited snapshot as current") + }, + {.name = "rename", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("allow renaming an existing snapshot") + }, + {.name = "clone", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("allow cloning to new name") + }, + {.name = NULL} }; static bool @@ -556,13 +670,27 @@ static const vshCmdInfo info_snapshot_current[] = { }; static const vshCmdOptDef opts_snapshot_current[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"name", VSH_OT_BOOL, 0, N_("list the name, rather than the full xml")}, - {"security-info", VSH_OT_BOOL, 0, - N_("include security sensitive information in XML dump")}, - {"snapshotname", VSH_OT_DATA, 0, - N_("name of existing snapshot to make current")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "name", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("list the name, rather than the full xml") + }, + {.name = "security-info", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("include security sensitive information in XML dump") + }, + {.name = "snapshotname", + .type = VSH_OT_DATA, + .flags = 0, + .help = N_("name of existing snapshot to make current") + }, + {.name = NULL} }; static bool @@ -782,10 +910,22 @@ static const vshCmdInfo info_snapshot_info[] = { }; static const vshCmdOptDef opts_snapshot_info[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"snapshotname", VSH_OT_DATA, 0, N_("snapshot name")}, - {"current", VSH_OT_BOOL, 0, N_("info on current snapshot")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "snapshotname", + .type = VSH_OT_DATA, + .flags = 0, + .help = N_("snapshot name") + }, + {.name = "current", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("info on current snapshot") + }, + {.name = NULL} }; static bool @@ -1325,29 +1465,87 @@ static const vshCmdInfo info_snapshot_list[] = { }; static const vshCmdOptDef opts_snapshot_list[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"parent", VSH_OT_BOOL, 0, N_("add a column showing parent snapshot")}, - {"roots", VSH_OT_BOOL, 0, N_("list only snapshots without parents")}, - {"leaves", VSH_OT_BOOL, 0, N_("list only snapshots without children")}, - {"no-leaves", VSH_OT_BOOL, 0, - N_("list only snapshots that are not leaves (with children)")}, - {"metadata", VSH_OT_BOOL, 0, - N_("list only snapshots that have metadata that would prevent undefine")}, - {"no-metadata", VSH_OT_BOOL, 0, - N_("list only snapshots that have no metadata managed by libvirt")}, - {"inactive", VSH_OT_BOOL, 0, - N_("filter by snapshots taken while inactive")}, - {"active", VSH_OT_BOOL, 0, - N_("filter by snapshots taken while active (system checkpoints)")}, - {"disk-only", VSH_OT_BOOL, 0, N_("filter by disk-only snapshots")}, - {"internal", VSH_OT_BOOL, 0, N_("filter by internal snapshots")}, - {"external", VSH_OT_BOOL, 0, N_("filter by external snapshots")}, - {"tree", VSH_OT_BOOL, 0, N_("list snapshots in a tree")}, - {"from", VSH_OT_DATA, 0, N_("limit list to children of given snapshot")}, - {"current", VSH_OT_BOOL, 0, - N_("limit list to children of current snapshot")}, - {"descendants", VSH_OT_BOOL, 0, N_("with --from, list all descendants")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "parent", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("add a column showing parent snapshot") + }, + {.name = "roots", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("list only snapshots without parents") + }, + {.name = "leaves", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("list only snapshots without children") + }, + {.name = "no-leaves", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("list only snapshots that are not leaves (with children)") + }, + {.name = "metadata", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("list only snapshots that have metadata that would prevent undefine") + }, + {.name = "no-metadata", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("list only snapshots that have no metadata managed by libvirt") + }, + {.name = "inactive", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("filter by snapshots taken while inactive") + }, + {.name = "active", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("filter by snapshots taken while active (system checkpoints)") + }, + {.name = "disk-only", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("filter by disk-only snapshots") + }, + {.name = "internal", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("filter by internal snapshots") + }, + {.name = "external", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("filter by external snapshots") + }, + {.name = "tree", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("list snapshots in a tree") + }, + {.name = "from", + .type = VSH_OT_DATA, + .flags = 0, + .help = N_("limit list to children of given snapshot") + }, + {.name = "current", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("limit list to children of current snapshot") + }, + {.name = "descendants", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("with --from, list all descendants") + }, + {.name = NULL} }; static bool @@ -1555,11 +1753,22 @@ static const vshCmdInfo info_snapshot_dumpxml[] = { }; static const vshCmdOptDef opts_snapshot_dumpxml[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"snapshotname", VSH_OT_DATA, VSH_OFLAG_REQ, N_("snapshot name")}, - {"security-info", VSH_OT_BOOL, 0, - N_("include security sensitive information in XML dump")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "snapshotname", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("snapshot name") + }, + {.name = "security-info", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("include security sensitive information in XML dump") + }, + {.name = NULL} }; static bool @@ -1614,10 +1823,22 @@ static const vshCmdInfo info_snapshot_parent[] = { }; static const vshCmdOptDef opts_snapshot_parent[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"snapshotname", VSH_OT_DATA, 0, N_("find parent of snapshot name")}, - {"current", VSH_OT_BOOL, 0, N_("find parent of current snapshot")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "snapshotname", + .type = VSH_OT_DATA, + .flags = 0, + .help = N_("find parent of snapshot name") + }, + {.name = "current", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("find parent of current snapshot") + }, + {.name = NULL} }; static bool @@ -1668,13 +1889,37 @@ static const vshCmdInfo info_snapshot_revert[] = { }; static const vshCmdOptDef opts_snapshot_revert[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"snapshotname", VSH_OT_DATA, 0, N_("snapshot name")}, - {"current", VSH_OT_BOOL, 0, N_("revert to current snapshot")}, - {"running", VSH_OT_BOOL, 0, N_("after reverting, change state to running")}, - {"paused", VSH_OT_BOOL, 0, N_("after reverting, change state to paused")}, - {"force", VSH_OT_BOOL, 0, N_("try harder on risky reverts")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "snapshotname", + .type = VSH_OT_DATA, + .flags = 0, + .help = N_("snapshot name") + }, + {.name = "current", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("revert to current snapshot") + }, + {.name = "running", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("after reverting, change state to running") + }, + {.name = "paused", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("after reverting, change state to paused") + }, + {.name = "force", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("try harder on risky reverts") + }, + {.name = NULL} }; static bool @@ -1738,14 +1983,37 @@ static const vshCmdInfo info_snapshot_delete[] = { }; static const vshCmdOptDef opts_snapshot_delete[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"snapshotname", VSH_OT_DATA, 0, N_("snapshot name")}, - {"current", VSH_OT_BOOL, 0, N_("delete current snapshot")}, - {"children", VSH_OT_BOOL, 0, N_("delete snapshot and all children")}, - {"children-only", VSH_OT_BOOL, 0, N_("delete children but not snapshot")}, - {"metadata", VSH_OT_BOOL, 0, - N_("delete only libvirt metadata, leaving snapshot contents behind")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "snapshotname", + .type = VSH_OT_DATA, + .flags = 0, + .help = N_("snapshot name") + }, + {.name = "current", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("delete current snapshot") + }, + {.name = "children", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("delete snapshot and all children") + }, + {.name = "children-only", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("delete children but not snapshot") + }, + {.name = "metadata", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("delete only libvirt metadata, leaving snapshot contents behind") + }, + {.name = NULL} }; static bool -- 1.8.0.2

On 01/14/2013 11:59 PM, Michal Privoznik wrote:
--- tools/virsh-snapshot.c | 452 +++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 360 insertions(+), 92 deletions(-)
diff --git a/tools/virsh-snapshot.c b/tools/virsh-snapshot.c index 3b179e2..e4745d6 100644 --- a/tools/virsh-snapshot.c +++ b/tools/virsh-snapshot.c @@ -118,18 +118,62 @@ static const vshCmdInfo info_snapshot_create[] = { };
static const vshCmdOptDef opts_snapshot_create[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"xmlfile", VSH_OT_DATA, 0, N_("domain snapshot XML")}, - {"redefine", VSH_OT_BOOL, 0, N_("redefine metadata for existing snapshot")}, - {"current", VSH_OT_BOOL, 0, N_("with redefine, set current snapshot")}, - {"no-metadata", VSH_OT_BOOL, 0, N_("take snapshot but create no metadata")}, - {"halt", VSH_OT_BOOL, 0, N_("halt domain after snapshot is created")}, - {"disk-only", VSH_OT_BOOL, 0, N_("capture disk state but not vm state")}, - {"reuse-external", VSH_OT_BOOL, 0, N_("reuse any existing external files")}, - {"quiesce", VSH_OT_BOOL, 0, N_("quiesce guest's file systems")}, - {"atomic", VSH_OT_BOOL, 0, N_("require atomic operation")}, - {"live", VSH_OT_BOOL, 0, N_("take a live snapshot")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "xmlfile", + .type = VSH_OT_DATA, + .flags = 0, + .help = N_("domain snapshot XML") + }, + {.name = "redefine", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("redefine metadata for existing snapshot") + }, + {.name = "current", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("with redefine, set current snapshot") + }, + {.name = "no-metadata", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("take snapshot but create no metadata") + }, + {.name = "halt", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("halt domain after snapshot is created") + }, + {.name = "disk-only", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("capture disk state but not vm state") + }, + {.name = "reuse-external", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("reuse any existing external files") + }, + {.name = "quiesce", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("quiesce guest's file systems") + }, + {.name = "atomic", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("require atomic operation") + }, + {.name = "live", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("take a live snapshot") + }, + {.name = NULL} };
static bool @@ -296,22 +340,72 @@ static const vshCmdInfo info_snapshot_create_as[] = { };
static const vshCmdOptDef opts_snapshot_create_as[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"name", VSH_OT_DATA, 0, N_("name of snapshot")}, - {"description", VSH_OT_DATA, 0, N_("description of snapshot")}, - {"print-xml", VSH_OT_BOOL, 0, N_("print XML document rather than create")}, - {"no-metadata", VSH_OT_BOOL, 0, N_("take snapshot but create no metadata")}, - {"halt", VSH_OT_BOOL, 0, N_("halt domain after snapshot is created")}, - {"disk-only", VSH_OT_BOOL, 0, N_("capture disk state but not vm state")}, - {"reuse-external", VSH_OT_BOOL, 0, N_("reuse any existing external files")}, - {"quiesce", VSH_OT_BOOL, 0, N_("quiesce guest's file systems")}, - {"atomic", VSH_OT_BOOL, 0, N_("require atomic operation")}, - {"live", VSH_OT_BOOL, 0, N_("take a live snapshot")}, - {"memspec", VSH_OT_DATA, VSH_OFLAG_REQ_OPT, - N_("memory attributes: [file=]name[,snapshot=type]")}, - {"diskspec", VSH_OT_ARGV, 0, - N_("disk attributes: disk[,snapshot=type][,driver=type][,file=name]")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "name", + .type = VSH_OT_DATA, + .flags = 0, + .help = N_("name of snapshot") + }, + {.name = "description", + .type = VSH_OT_DATA, + .flags = 0, + .help = N_("description of snapshot") + }, + {.name = "print-xml", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("print XML document rather than create") + }, + {.name = "no-metadata", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("take snapshot but create no metadata") + }, + {.name = "halt", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("halt domain after snapshot is created") + }, + {.name = "disk-only", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("capture disk state but not vm state") + }, + {.name = "reuse-external", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("reuse any existing external files") + }, + {.name = "quiesce", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("quiesce guest's file systems") + }, + {.name = "atomic", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("require atomic operation") + }, + {.name = "live", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("take a live snapshot") + }, + {.name = "memspec", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ_OPT, + .help = N_("memory attributes: [file=]name[,snapshot=type]") + }, + {.name = "diskspec", + .type = VSH_OT_ARGV, + .flags = 0, + .help = N_("disk attributes: disk[,snapshot=type][,driver=type][,file=name]") + }, + {.name = NULL} };
static bool @@ -448,12 +542,32 @@ static const vshCmdInfo info_snapshot_edit[] = { };
static const vshCmdOptDef opts_snapshot_edit[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"snapshotname", VSH_OT_DATA, 0, N_("snapshot name")}, - {"current", VSH_OT_BOOL, 0, N_("also set edited snapshot as current")}, - {"rename", VSH_OT_BOOL, 0, N_("allow renaming an existing snapshot")}, - {"clone", VSH_OT_BOOL, 0, N_("allow cloning to new name")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "snapshotname", + .type = VSH_OT_DATA, + .flags = 0, + .help = N_("snapshot name") + }, + {.name = "current", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("also set edited snapshot as current") + }, + {.name = "rename", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("allow renaming an existing snapshot") + }, + {.name = "clone", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("allow cloning to new name") + }, + {.name = NULL} };
static bool @@ -556,13 +670,27 @@ static const vshCmdInfo info_snapshot_current[] = { };
static const vshCmdOptDef opts_snapshot_current[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"name", VSH_OT_BOOL, 0, N_("list the name, rather than the full xml")}, - {"security-info", VSH_OT_BOOL, 0, - N_("include security sensitive information in XML dump")}, - {"snapshotname", VSH_OT_DATA, 0, - N_("name of existing snapshot to make current")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "name", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("list the name, rather than the full xml") + }, + {.name = "security-info", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("include security sensitive information in XML dump") + }, + {.name = "snapshotname", + .type = VSH_OT_DATA, + .flags = 0, + .help = N_("name of existing snapshot to make current") + }, + {.name = NULL} };
static bool @@ -782,10 +910,22 @@ static const vshCmdInfo info_snapshot_info[] = { };
static const vshCmdOptDef opts_snapshot_info[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"snapshotname", VSH_OT_DATA, 0, N_("snapshot name")}, - {"current", VSH_OT_BOOL, 0, N_("info on current snapshot")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "snapshotname", + .type = VSH_OT_DATA, + .flags = 0, + .help = N_("snapshot name") + }, + {.name = "current", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("info on current snapshot") + }, + {.name = NULL} };
static bool @@ -1325,29 +1465,87 @@ static const vshCmdInfo info_snapshot_list[] = { };
static const vshCmdOptDef opts_snapshot_list[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"parent", VSH_OT_BOOL, 0, N_("add a column showing parent snapshot")}, - {"roots", VSH_OT_BOOL, 0, N_("list only snapshots without parents")}, - {"leaves", VSH_OT_BOOL, 0, N_("list only snapshots without children")}, - {"no-leaves", VSH_OT_BOOL, 0, - N_("list only snapshots that are not leaves (with children)")}, - {"metadata", VSH_OT_BOOL, 0, - N_("list only snapshots that have metadata that would prevent undefine")}, - {"no-metadata", VSH_OT_BOOL, 0, - N_("list only snapshots that have no metadata managed by libvirt")}, - {"inactive", VSH_OT_BOOL, 0, - N_("filter by snapshots taken while inactive")}, - {"active", VSH_OT_BOOL, 0, - N_("filter by snapshots taken while active (system checkpoints)")}, - {"disk-only", VSH_OT_BOOL, 0, N_("filter by disk-only snapshots")}, - {"internal", VSH_OT_BOOL, 0, N_("filter by internal snapshots")}, - {"external", VSH_OT_BOOL, 0, N_("filter by external snapshots")}, - {"tree", VSH_OT_BOOL, 0, N_("list snapshots in a tree")}, - {"from", VSH_OT_DATA, 0, N_("limit list to children of given snapshot")}, - {"current", VSH_OT_BOOL, 0, - N_("limit list to children of current snapshot")}, - {"descendants", VSH_OT_BOOL, 0, N_("with --from, list all descendants")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "parent", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("add a column showing parent snapshot") + }, + {.name = "roots", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("list only snapshots without parents") + }, + {.name = "leaves", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("list only snapshots without children") + }, + {.name = "no-leaves", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("list only snapshots that are not leaves (with children)") + }, + {.name = "metadata", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("list only snapshots that have metadata that would prevent undefine") + }, + {.name = "no-metadata", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("list only snapshots that have no metadata managed by libvirt") + }, + {.name = "inactive", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("filter by snapshots taken while inactive") + }, + {.name = "active", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("filter by snapshots taken while active (system checkpoints)") + }, + {.name = "disk-only", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("filter by disk-only snapshots") + }, + {.name = "internal", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("filter by internal snapshots") + }, + {.name = "external", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("filter by external snapshots") + }, + {.name = "tree", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("list snapshots in a tree") + }, + {.name = "from", + .type = VSH_OT_DATA, + .flags = 0, + .help = N_("limit list to children of given snapshot") + }, + {.name = "current", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("limit list to children of current snapshot") + }, + {.name = "descendants", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("with --from, list all descendants") + }, + {.name = NULL} };
static bool @@ -1555,11 +1753,22 @@ static const vshCmdInfo info_snapshot_dumpxml[] = { };
static const vshCmdOptDef opts_snapshot_dumpxml[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"snapshotname", VSH_OT_DATA, VSH_OFLAG_REQ, N_("snapshot name")}, - {"security-info", VSH_OT_BOOL, 0, - N_("include security sensitive information in XML dump")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "snapshotname", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("snapshot name") + }, + {.name = "security-info", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("include security sensitive information in XML dump") + }, + {.name = NULL} };
static bool @@ -1614,10 +1823,22 @@ static const vshCmdInfo info_snapshot_parent[] = { };
static const vshCmdOptDef opts_snapshot_parent[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"snapshotname", VSH_OT_DATA, 0, N_("find parent of snapshot name")}, - {"current", VSH_OT_BOOL, 0, N_("find parent of current snapshot")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "snapshotname", + .type = VSH_OT_DATA, + .flags = 0, + .help = N_("find parent of snapshot name") + }, + {.name = "current", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("find parent of current snapshot") + }, + {.name = NULL} };
static bool @@ -1668,13 +1889,37 @@ static const vshCmdInfo info_snapshot_revert[] = { };
static const vshCmdOptDef opts_snapshot_revert[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"snapshotname", VSH_OT_DATA, 0, N_("snapshot name")}, - {"current", VSH_OT_BOOL, 0, N_("revert to current snapshot")}, - {"running", VSH_OT_BOOL, 0, N_("after reverting, change state to running")}, - {"paused", VSH_OT_BOOL, 0, N_("after reverting, change state to paused")}, - {"force", VSH_OT_BOOL, 0, N_("try harder on risky reverts")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "snapshotname", + .type = VSH_OT_DATA, + .flags = 0, + .help = N_("snapshot name") + }, + {.name = "current", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("revert to current snapshot") + }, + {.name = "running", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("after reverting, change state to running") + }, + {.name = "paused", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("after reverting, change state to paused") + }, + {.name = "force", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("try harder on risky reverts") + }, + {.name = NULL} };
static bool @@ -1738,14 +1983,37 @@ static const vshCmdInfo info_snapshot_delete[] = { };
static const vshCmdOptDef opts_snapshot_delete[] = { - {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")}, - {"snapshotname", VSH_OT_DATA, 0, N_("snapshot name")}, - {"current", VSH_OT_BOOL, 0, N_("delete current snapshot")}, - {"children", VSH_OT_BOOL, 0, N_("delete snapshot and all children")}, - {"children-only", VSH_OT_BOOL, 0, N_("delete children but not snapshot")}, - {"metadata", VSH_OT_BOOL, 0, - N_("delete only libvirt metadata, leaving snapshot contents behind")}, - {NULL, 0, 0, NULL} + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "snapshotname", + .type = VSH_OT_DATA, + .flags = 0, + .help = N_("snapshot name") + }, + {.name = "current", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("delete current snapshot") + }, + {.name = "children", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("delete snapshot and all children") + }, + {.name = "children-only", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("delete children but not snapshot") + }, + {.name = "metadata", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("delete only libvirt metadata, leaving snapshot contents behind") + }, + {.name = NULL} };
static bool
ACK

--- tools/virsh-volume.c | 368 +++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 286 insertions(+), 82 deletions(-) diff --git a/tools/virsh-volume.c b/tools/virsh-volume.c index a57fc28..e17d946 100644 --- a/tools/virsh-volume.c +++ b/tools/virsh-volume.c @@ -112,21 +112,47 @@ static const vshCmdInfo info_vol_create_as[] = { }; static const vshCmdOptDef opts_vol_create_as[] = { - {"pool", VSH_OT_DATA, VSH_OFLAG_REQ, N_("pool name")}, - {"name", VSH_OT_DATA, VSH_OFLAG_REQ, N_("name of the volume")}, - {"capacity", VSH_OT_DATA, VSH_OFLAG_REQ, - N_("size of the vol, as scaled integer (default bytes)")}, - {"allocation", VSH_OT_STRING, 0, - N_("initial allocation size, as scaled integer (default bytes)")}, - {"format", VSH_OT_STRING, 0, - N_("file format type raw,bochs,qcow,qcow2,qed,vmdk")}, - {"backing-vol", VSH_OT_STRING, 0, - N_("the backing volume if taking a snapshot")}, - {"backing-vol-format", VSH_OT_STRING, 0, - N_("format of backing volume if taking a snapshot")}, - {"prealloc-metadata", VSH_OT_BOOL, 0, N_("preallocate metadata (for qcow2 " - "instead of full allocation)")}, - {NULL, 0, 0, NULL} + {.name = "pool", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("pool name") + }, + {.name = "name", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("name of the volume") + }, + {.name = "capacity", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("size of the vol, as scaled integer (default bytes)") + }, + {.name = "allocation", + .type = VSH_OT_STRING, + .flags = 0, + .help = N_("initial allocation size, as scaled integer (default bytes)") + }, + {.name = "format", + .type = VSH_OT_STRING, + .flags = 0, + .help = N_("file format type raw,bochs,qcow,qcow2,qed,vmdk") + }, + {.name = "backing-vol", + .type = VSH_OT_STRING, + .flags = 0, + .help = N_("the backing volume if taking a snapshot") + }, + {.name = "backing-vol-format", + .type = VSH_OT_STRING, + .flags = 0, + .help = N_("format of backing volume if taking a snapshot") + }, + {.name = "prealloc-metadata", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("preallocate metadata (for qcow2 instead of full allocation)") + }, + {.name = NULL} }; static int @@ -290,11 +316,22 @@ static const vshCmdInfo info_vol_create[] = { }; static const vshCmdOptDef opts_vol_create[] = { - {"pool", VSH_OT_DATA, VSH_OFLAG_REQ, N_("pool name")}, - {"file", VSH_OT_DATA, VSH_OFLAG_REQ, N_("file containing an XML vol description")}, - {"prealloc-metadata", VSH_OT_BOOL, 0, N_("preallocate metadata (for qcow2 " - "instead of full allocation)")}, - {NULL, 0, 0, NULL} + {.name = "pool", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("pool name") + }, + {.name = "file", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("file containing an XML vol description") + }, + {.name = "prealloc-metadata", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("preallocate metadata (for qcow2 instead of full allocation)") + }, + {.name = NULL} }; static bool @@ -349,13 +386,32 @@ static const vshCmdInfo info_vol_create_from[] = { }; static const vshCmdOptDef opts_vol_create_from[] = { - {"pool", VSH_OT_DATA, VSH_OFLAG_REQ, N_("pool name or uuid")}, - {"file", VSH_OT_DATA, VSH_OFLAG_REQ, N_("file containing an XML vol description")}, - {"vol", VSH_OT_DATA, VSH_OFLAG_REQ, N_("input vol name or key")}, - {"inputpool", VSH_OT_STRING, 0, N_("pool name or uuid of the input volume's pool")}, - {"prealloc-metadata", VSH_OT_BOOL, 0, N_("preallocate metadata (for qcow2 " - "instead of full allocation)")}, - {NULL, 0, 0, NULL} + {.name = "pool", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("pool name or uuid") + }, + {.name = "file", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("file containing an XML vol description") + }, + {.name = "vol", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("input vol name or key") + }, + {.name = "inputpool", + .type = VSH_OT_STRING, + .flags = 0, + .help = N_("pool name or uuid of the input volume's pool") + }, + {.name = "prealloc-metadata", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("preallocate metadata (for qcow2 instead of full allocation)") + }, + {.name = NULL} }; static bool @@ -446,12 +502,27 @@ static const vshCmdInfo info_vol_clone[] = { }; static const vshCmdOptDef opts_vol_clone[] = { - {"vol", VSH_OT_DATA, VSH_OFLAG_REQ, N_("orig vol name or key")}, - {"newname", VSH_OT_DATA, VSH_OFLAG_REQ, N_("clone name")}, - {"pool", VSH_OT_STRING, 0, N_("pool name or uuid")}, - {"prealloc-metadata", VSH_OT_BOOL, 0, N_("preallocate metadata (for qcow2 " - "instead of full allocation)")}, - {NULL, 0, 0, NULL} + {.name = "vol", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("orig vol name or key") + }, + {.name = "newname", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("clone name") + }, + {.name = "pool", + .type = VSH_OT_STRING, + .flags = 0, + .help = N_("pool name or uuid") + }, + {.name = "prealloc-metadata", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("preallocate metadata (for qcow2 instead of full allocation)") + }, + {.name = NULL} }; static bool @@ -525,12 +596,32 @@ static const vshCmdInfo info_vol_upload[] = { }; static const vshCmdOptDef opts_vol_upload[] = { - {"vol", VSH_OT_DATA, VSH_OFLAG_REQ, N_("vol name, key or path")}, - {"file", VSH_OT_DATA, VSH_OFLAG_REQ, N_("file")}, - {"pool", VSH_OT_STRING, 0, N_("pool name or uuid")}, - {"offset", VSH_OT_INT, 0, N_("volume offset to upload to") }, - {"length", VSH_OT_INT, 0, N_("amount of data to upload") }, - {NULL, 0, 0, NULL} + {.name = "vol", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("vol name, key or path") + }, + {.name = "file", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("file") + }, + {.name = "pool", + .type = VSH_OT_STRING, + .flags = 0, + .help = N_("pool name or uuid") + }, + {.name = "offset", + .type = VSH_OT_INT, + .flags = 0, + .help = N_("volume offset to upload to") + }, + {.name = "length", + .type = VSH_OT_INT, + .flags = 0, + .help = N_("amount of data to upload") + }, + {.name = NULL} }; static int @@ -620,12 +711,32 @@ static const vshCmdInfo info_vol_download[] = { }; static const vshCmdOptDef opts_vol_download[] = { - {"vol", VSH_OT_DATA, VSH_OFLAG_REQ, N_("vol name, key or path")}, - {"file", VSH_OT_DATA, VSH_OFLAG_REQ, N_("file")}, - {"pool", VSH_OT_STRING, 0, N_("pool name or uuid")}, - {"offset", VSH_OT_INT, 0, N_("volume offset to download from") }, - {"length", VSH_OT_INT, 0, N_("amount of data to download") }, - {NULL, 0, 0, NULL} + {.name = "vol", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("vol name, key or path") + }, + {.name = "file", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("file") + }, + {.name = "pool", + .type = VSH_OT_STRING, + .flags = 0, + .help = N_("pool name or uuid") + }, + {.name = "offset", + .type = VSH_OT_INT, + .flags = 0, + .help = N_("volume offset to download from") + }, + {.name = "length", + .type = VSH_OT_INT, + .flags = 0, + .help = N_("amount of data to download") + }, + {.name = NULL} }; static bool @@ -713,9 +824,17 @@ static const vshCmdInfo info_vol_delete[] = { }; static const vshCmdOptDef opts_vol_delete[] = { - {"vol", VSH_OT_DATA, VSH_OFLAG_REQ, N_("vol name, key or path")}, - {"pool", VSH_OT_STRING, 0, N_("pool name or uuid")}, - {NULL, 0, 0, NULL} + {.name = "vol", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("vol name, key or path") + }, + {.name = "pool", + .type = VSH_OT_STRING, + .flags = 0, + .help = N_("pool name or uuid") + }, + {.name = NULL} }; static bool @@ -750,10 +869,22 @@ static const vshCmdInfo info_vol_wipe[] = { }; static const vshCmdOptDef opts_vol_wipe[] = { - {"vol", VSH_OT_DATA, VSH_OFLAG_REQ, N_("vol name, key or path")}, - {"pool", VSH_OT_STRING, 0, N_("pool name or uuid")}, - {"algorithm", VSH_OT_STRING, 0, N_("perform selected wiping algorithm")}, - {NULL, 0, 0, NULL} + {.name = "vol", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("vol name, key or path") + }, + {.name = "pool", + .type = VSH_OT_STRING, + .flags = 0, + .help = N_("pool name or uuid") + }, + {.name = "algorithm", + .type = VSH_OT_STRING, + .flags = 0, + .help = N_("perform selected wiping algorithm") + }, + {.name = NULL} }; VIR_ENUM_DECL(virStorageVolWipeAlgorithm) @@ -814,9 +945,17 @@ static const vshCmdInfo info_vol_info[] = { }; static const vshCmdOptDef opts_vol_info[] = { - {"vol", VSH_OT_DATA, VSH_OFLAG_REQ, N_("vol name, key or path")}, - {"pool", VSH_OT_STRING, 0, N_("pool name or uuid")}, - {NULL, 0, 0, NULL} + {.name = "vol", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("vol name, key or path") + }, + {.name = "pool", + .type = VSH_OT_STRING, + .flags = 0, + .help = N_("pool name or uuid") + }, + {.name = NULL} }; static bool @@ -878,16 +1017,37 @@ static const vshCmdInfo info_vol_resize[] = { }; static const vshCmdOptDef opts_vol_resize[] = { - {"vol", VSH_OT_DATA, VSH_OFLAG_REQ, N_("vol name, key or path")}, - {"capacity", VSH_OT_DATA, VSH_OFLAG_REQ, - N_("new capacity for the vol, as scaled integer (default bytes)")}, - {"pool", VSH_OT_STRING, 0, N_("pool name or uuid")}, - {"allocate", VSH_OT_BOOL, 0, - N_("allocate the new capacity, rather than leaving it sparse")}, - {"delta", VSH_OT_BOOL, 0, - N_("use capacity as a delta to current size, rather than the new size")}, - {"shrink", VSH_OT_BOOL, 0, N_("allow the resize to shrink the volume")}, - {NULL, 0, 0, NULL} + {.name = "vol", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("vol name, key or path") + }, + {.name = "capacity", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("new capacity for the vol, as scaled integer (default bytes)") + }, + {.name = "pool", + .type = VSH_OT_STRING, + .flags = 0, + .help = N_("pool name or uuid") + }, + {.name = "allocate", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("allocate the new capacity, rather than leaving it sparse") + }, + {.name = "delta", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("use capacity as a delta to current size, rather than the new size") + }, + {.name = "shrink", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("allow the resize to shrink the volume") + }, + {.name = NULL} }; static bool @@ -960,9 +1120,17 @@ static const vshCmdInfo info_vol_dumpxml[] = { }; static const vshCmdOptDef opts_vol_dumpxml[] = { - {"vol", VSH_OT_DATA, VSH_OFLAG_REQ, N_("vol name, key or path")}, - {"pool", VSH_OT_STRING, 0, N_("pool name or uuid")}, - {NULL, 0, 0, NULL} + {.name = "vol", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("vol name, key or path") + }, + {.name = "pool", + .type = VSH_OT_STRING, + .flags = 0, + .help = N_("pool name or uuid") + }, + {.name = NULL} }; static bool @@ -1122,9 +1290,17 @@ static const vshCmdInfo info_vol_list[] = { }; static const vshCmdOptDef opts_vol_list[] = { - {"pool", VSH_OT_DATA, VSH_OFLAG_REQ, N_("pool name or uuid")}, - {"details", VSH_OT_BOOL, 0, N_("display extended details for volumes")}, - {NULL, 0, 0, NULL} + {.name = "pool", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("pool name or uuid") + }, + {.name = "details", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("display extended details for volumes") + }, + {.name = NULL} }; static bool @@ -1391,8 +1567,12 @@ static const vshCmdInfo info_vol_name[] = { }; static const vshCmdOptDef opts_vol_name[] = { - {"vol", VSH_OT_DATA, VSH_OFLAG_REQ, N_("volume key or path")}, - {NULL, 0, 0, NULL} + {.name = "vol", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("volume key or path") + }, + {.name = NULL} }; static bool @@ -1419,9 +1599,17 @@ static const vshCmdInfo info_vol_pool[] = { }; static const vshCmdOptDef opts_vol_pool[] = { - {"uuid", VSH_OT_BOOL, 0, N_("return the pool uuid rather than pool name")}, - {"vol", VSH_OT_DATA, VSH_OFLAG_REQ, N_("volume key or path")}, - {NULL, 0, 0, NULL} + {.name = "uuid", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("return the pool uuid rather than pool name") + }, + {.name = "vol", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("volume key or path") + }, + {.name = NULL} }; static bool @@ -1471,9 +1659,17 @@ static const vshCmdInfo info_vol_key[] = { }; static const vshCmdOptDef opts_vol_key[] = { - {"vol", VSH_OT_DATA, VSH_OFLAG_REQ, N_("volume name or path")}, - {"pool", VSH_OT_STRING, 0, N_("pool name or uuid")}, - {NULL, 0, 0, NULL} + {.name = "vol", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("volume name or path") + }, + {.name = "pool", + .type = VSH_OT_STRING, + .flags = 0, + .help = N_("pool name or uuid") + }, + {.name = NULL} }; static bool @@ -1499,9 +1695,17 @@ static const vshCmdInfo info_vol_path[] = { }; static const vshCmdOptDef opts_vol_path[] = { - {"vol", VSH_OT_DATA, VSH_OFLAG_REQ, N_("volume name or key")}, - {"pool", VSH_OT_STRING, 0, N_("pool name or uuid")}, - {NULL, 0, 0, NULL} + {.name = "vol", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("volume name or key") + }, + {.name = "pool", + .type = VSH_OT_STRING, + .flags = 0, + .help = N_("pool name or uuid") + }, + {.name = NULL} }; static bool -- 1.8.0.2

On 01/14/2013 11:59 PM, Michal Privoznik wrote:
--- tools/virsh-volume.c | 368 +++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 286 insertions(+), 82 deletions(-)
diff --git a/tools/virsh-volume.c b/tools/virsh-volume.c index a57fc28..e17d946 100644 --- a/tools/virsh-volume.c +++ b/tools/virsh-volume.c @@ -112,21 +112,47 @@ static const vshCmdInfo info_vol_create_as[] = { };
static const vshCmdOptDef opts_vol_create_as[] = { - {"pool", VSH_OT_DATA, VSH_OFLAG_REQ, N_("pool name")}, - {"name", VSH_OT_DATA, VSH_OFLAG_REQ, N_("name of the volume")}, - {"capacity", VSH_OT_DATA, VSH_OFLAG_REQ, - N_("size of the vol, as scaled integer (default bytes)")}, - {"allocation", VSH_OT_STRING, 0, - N_("initial allocation size, as scaled integer (default bytes)")}, - {"format", VSH_OT_STRING, 0, - N_("file format type raw,bochs,qcow,qcow2,qed,vmdk")}, - {"backing-vol", VSH_OT_STRING, 0, - N_("the backing volume if taking a snapshot")}, - {"backing-vol-format", VSH_OT_STRING, 0, - N_("format of backing volume if taking a snapshot")}, - {"prealloc-metadata", VSH_OT_BOOL, 0, N_("preallocate metadata (for qcow2 " - "instead of full allocation)")}, - {NULL, 0, 0, NULL} + {.name = "pool", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("pool name") + }, + {.name = "name", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("name of the volume") + }, + {.name = "capacity", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("size of the vol, as scaled integer (default bytes)") + }, + {.name = "allocation", + .type = VSH_OT_STRING, + .flags = 0, + .help = N_("initial allocation size, as scaled integer (default bytes)") + }, + {.name = "format", + .type = VSH_OT_STRING, + .flags = 0, + .help = N_("file format type raw,bochs,qcow,qcow2,qed,vmdk") + }, + {.name = "backing-vol", + .type = VSH_OT_STRING, + .flags = 0, + .help = N_("the backing volume if taking a snapshot") + }, + {.name = "backing-vol-format", + .type = VSH_OT_STRING, + .flags = 0, + .help = N_("format of backing volume if taking a snapshot") + }, + {.name = "prealloc-metadata", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("preallocate metadata (for qcow2 instead of full allocation)") + }, + {.name = NULL} };
static int @@ -290,11 +316,22 @@ static const vshCmdInfo info_vol_create[] = { };
static const vshCmdOptDef opts_vol_create[] = { - {"pool", VSH_OT_DATA, VSH_OFLAG_REQ, N_("pool name")}, - {"file", VSH_OT_DATA, VSH_OFLAG_REQ, N_("file containing an XML vol description")}, - {"prealloc-metadata", VSH_OT_BOOL, 0, N_("preallocate metadata (for qcow2 " - "instead of full allocation)")}, - {NULL, 0, 0, NULL} + {.name = "pool", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("pool name") + }, + {.name = "file", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("file containing an XML vol description") + }, + {.name = "prealloc-metadata", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("preallocate metadata (for qcow2 instead of full allocation)") + }, + {.name = NULL} };
static bool @@ -349,13 +386,32 @@ static const vshCmdInfo info_vol_create_from[] = { };
static const vshCmdOptDef opts_vol_create_from[] = { - {"pool", VSH_OT_DATA, VSH_OFLAG_REQ, N_("pool name or uuid")}, - {"file", VSH_OT_DATA, VSH_OFLAG_REQ, N_("file containing an XML vol description")}, - {"vol", VSH_OT_DATA, VSH_OFLAG_REQ, N_("input vol name or key")}, - {"inputpool", VSH_OT_STRING, 0, N_("pool name or uuid of the input volume's pool")}, - {"prealloc-metadata", VSH_OT_BOOL, 0, N_("preallocate metadata (for qcow2 " - "instead of full allocation)")}, - {NULL, 0, 0, NULL} + {.name = "pool", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("pool name or uuid") + }, + {.name = "file", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("file containing an XML vol description") + }, + {.name = "vol", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("input vol name or key") + }, + {.name = "inputpool", + .type = VSH_OT_STRING, + .flags = 0, + .help = N_("pool name or uuid of the input volume's pool") + }, + {.name = "prealloc-metadata", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("preallocate metadata (for qcow2 instead of full allocation)") + }, + {.name = NULL} };
static bool @@ -446,12 +502,27 @@ static const vshCmdInfo info_vol_clone[] = { };
static const vshCmdOptDef opts_vol_clone[] = { - {"vol", VSH_OT_DATA, VSH_OFLAG_REQ, N_("orig vol name or key")}, - {"newname", VSH_OT_DATA, VSH_OFLAG_REQ, N_("clone name")}, - {"pool", VSH_OT_STRING, 0, N_("pool name or uuid")}, - {"prealloc-metadata", VSH_OT_BOOL, 0, N_("preallocate metadata (for qcow2 " - "instead of full allocation)")}, - {NULL, 0, 0, NULL} + {.name = "vol", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("orig vol name or key") + }, + {.name = "newname", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("clone name") + }, + {.name = "pool", + .type = VSH_OT_STRING, + .flags = 0, + .help = N_("pool name or uuid") + }, + {.name = "prealloc-metadata", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("preallocate metadata (for qcow2 instead of full allocation)") + }, + {.name = NULL} };
static bool @@ -525,12 +596,32 @@ static const vshCmdInfo info_vol_upload[] = { };
static const vshCmdOptDef opts_vol_upload[] = { - {"vol", VSH_OT_DATA, VSH_OFLAG_REQ, N_("vol name, key or path")}, - {"file", VSH_OT_DATA, VSH_OFLAG_REQ, N_("file")}, - {"pool", VSH_OT_STRING, 0, N_("pool name or uuid")}, - {"offset", VSH_OT_INT, 0, N_("volume offset to upload to") }, - {"length", VSH_OT_INT, 0, N_("amount of data to upload") }, - {NULL, 0, 0, NULL} + {.name = "vol", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("vol name, key or path") + }, + {.name = "file", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("file") + }, + {.name = "pool", + .type = VSH_OT_STRING, + .flags = 0, + .help = N_("pool name or uuid") + }, + {.name = "offset", + .type = VSH_OT_INT, + .flags = 0, + .help = N_("volume offset to upload to") + }, + {.name = "length", + .type = VSH_OT_INT, + .flags = 0, + .help = N_("amount of data to upload") + }, + {.name = NULL} };
static int @@ -620,12 +711,32 @@ static const vshCmdInfo info_vol_download[] = { };
static const vshCmdOptDef opts_vol_download[] = { - {"vol", VSH_OT_DATA, VSH_OFLAG_REQ, N_("vol name, key or path")}, - {"file", VSH_OT_DATA, VSH_OFLAG_REQ, N_("file")}, - {"pool", VSH_OT_STRING, 0, N_("pool name or uuid")}, - {"offset", VSH_OT_INT, 0, N_("volume offset to download from") }, - {"length", VSH_OT_INT, 0, N_("amount of data to download") }, - {NULL, 0, 0, NULL} + {.name = "vol", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("vol name, key or path") + }, + {.name = "file", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("file") + }, + {.name = "pool", + .type = VSH_OT_STRING, + .flags = 0, + .help = N_("pool name or uuid") + }, + {.name = "offset", + .type = VSH_OT_INT, + .flags = 0, + .help = N_("volume offset to download from") + }, + {.name = "length", + .type = VSH_OT_INT, + .flags = 0, + .help = N_("amount of data to download") + }, + {.name = NULL} };
static bool @@ -713,9 +824,17 @@ static const vshCmdInfo info_vol_delete[] = { };
static const vshCmdOptDef opts_vol_delete[] = { - {"vol", VSH_OT_DATA, VSH_OFLAG_REQ, N_("vol name, key or path")}, - {"pool", VSH_OT_STRING, 0, N_("pool name or uuid")}, - {NULL, 0, 0, NULL} + {.name = "vol", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("vol name, key or path") + }, + {.name = "pool", + .type = VSH_OT_STRING, + .flags = 0, + .help = N_("pool name or uuid") + }, + {.name = NULL} };
static bool @@ -750,10 +869,22 @@ static const vshCmdInfo info_vol_wipe[] = { };
static const vshCmdOptDef opts_vol_wipe[] = { - {"vol", VSH_OT_DATA, VSH_OFLAG_REQ, N_("vol name, key or path")}, - {"pool", VSH_OT_STRING, 0, N_("pool name or uuid")}, - {"algorithm", VSH_OT_STRING, 0, N_("perform selected wiping algorithm")}, - {NULL, 0, 0, NULL} + {.name = "vol", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("vol name, key or path") + }, + {.name = "pool", + .type = VSH_OT_STRING, + .flags = 0, + .help = N_("pool name or uuid") + }, + {.name = "algorithm", + .type = VSH_OT_STRING, + .flags = 0, + .help = N_("perform selected wiping algorithm") + }, + {.name = NULL} };
VIR_ENUM_DECL(virStorageVolWipeAlgorithm) @@ -814,9 +945,17 @@ static const vshCmdInfo info_vol_info[] = { };
static const vshCmdOptDef opts_vol_info[] = { - {"vol", VSH_OT_DATA, VSH_OFLAG_REQ, N_("vol name, key or path")}, - {"pool", VSH_OT_STRING, 0, N_("pool name or uuid")}, - {NULL, 0, 0, NULL} + {.name = "vol", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("vol name, key or path") + }, + {.name = "pool", + .type = VSH_OT_STRING, + .flags = 0, + .help = N_("pool name or uuid") + }, + {.name = NULL} };
static bool @@ -878,16 +1017,37 @@ static const vshCmdInfo info_vol_resize[] = { };
static const vshCmdOptDef opts_vol_resize[] = { - {"vol", VSH_OT_DATA, VSH_OFLAG_REQ, N_("vol name, key or path")}, - {"capacity", VSH_OT_DATA, VSH_OFLAG_REQ, - N_("new capacity for the vol, as scaled integer (default bytes)")}, - {"pool", VSH_OT_STRING, 0, N_("pool name or uuid")}, - {"allocate", VSH_OT_BOOL, 0, - N_("allocate the new capacity, rather than leaving it sparse")}, - {"delta", VSH_OT_BOOL, 0, - N_("use capacity as a delta to current size, rather than the new size")}, - {"shrink", VSH_OT_BOOL, 0, N_("allow the resize to shrink the volume")}, - {NULL, 0, 0, NULL} + {.name = "vol", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("vol name, key or path") + }, + {.name = "capacity", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("new capacity for the vol, as scaled integer (default bytes)") + }, + {.name = "pool", + .type = VSH_OT_STRING, + .flags = 0, + .help = N_("pool name or uuid") + }, + {.name = "allocate", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("allocate the new capacity, rather than leaving it sparse") + }, + {.name = "delta", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("use capacity as a delta to current size, rather than the new size") + }, + {.name = "shrink", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("allow the resize to shrink the volume") + }, + {.name = NULL} };
static bool @@ -960,9 +1120,17 @@ static const vshCmdInfo info_vol_dumpxml[] = { };
static const vshCmdOptDef opts_vol_dumpxml[] = { - {"vol", VSH_OT_DATA, VSH_OFLAG_REQ, N_("vol name, key or path")}, - {"pool", VSH_OT_STRING, 0, N_("pool name or uuid")}, - {NULL, 0, 0, NULL} + {.name = "vol", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("vol name, key or path") + }, + {.name = "pool", + .type = VSH_OT_STRING, + .flags = 0, + .help = N_("pool name or uuid") + }, + {.name = NULL} };
static bool @@ -1122,9 +1290,17 @@ static const vshCmdInfo info_vol_list[] = { };
static const vshCmdOptDef opts_vol_list[] = { - {"pool", VSH_OT_DATA, VSH_OFLAG_REQ, N_("pool name or uuid")}, - {"details", VSH_OT_BOOL, 0, N_("display extended details for volumes")}, - {NULL, 0, 0, NULL} + {.name = "pool", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("pool name or uuid") + }, + {.name = "details", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("display extended details for volumes") + }, + {.name = NULL} };
static bool @@ -1391,8 +1567,12 @@ static const vshCmdInfo info_vol_name[] = { };
static const vshCmdOptDef opts_vol_name[] = { - {"vol", VSH_OT_DATA, VSH_OFLAG_REQ, N_("volume key or path")}, - {NULL, 0, 0, NULL} + {.name = "vol", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("volume key or path") + }, + {.name = NULL} };
static bool @@ -1419,9 +1599,17 @@ static const vshCmdInfo info_vol_pool[] = { };
static const vshCmdOptDef opts_vol_pool[] = { - {"uuid", VSH_OT_BOOL, 0, N_("return the pool uuid rather than pool name")}, - {"vol", VSH_OT_DATA, VSH_OFLAG_REQ, N_("volume key or path")}, - {NULL, 0, 0, NULL} + {.name = "uuid", + .type = VSH_OT_BOOL, + .flags = 0, + .help = N_("return the pool uuid rather than pool name") + }, + {.name = "vol", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("volume key or path") + }, + {.name = NULL} };
static bool @@ -1471,9 +1659,17 @@ static const vshCmdInfo info_vol_key[] = { };
static const vshCmdOptDef opts_vol_key[] = { - {"vol", VSH_OT_DATA, VSH_OFLAG_REQ, N_("volume name or path")}, - {"pool", VSH_OT_STRING, 0, N_("pool name or uuid")}, - {NULL, 0, 0, NULL} + {.name = "vol", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("volume name or path") + }, + {.name = "pool", + .type = VSH_OT_STRING, + .flags = 0, + .help = N_("pool name or uuid") + }, + {.name = NULL} };
static bool @@ -1499,9 +1695,17 @@ static const vshCmdInfo info_vol_path[] = { };
static const vshCmdOptDef opts_vol_path[] = { - {"vol", VSH_OT_DATA, VSH_OFLAG_REQ, N_("volume name or key")}, - {"pool", VSH_OT_STRING, 0, N_("pool name or uuid")}, - {NULL, 0, 0, NULL} + {.name = "vol", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("volume name or key") + }, + {.name = "pool", + .type = VSH_OT_STRING, + .flags = 0, + .help = N_("pool name or uuid") + }, + {.name = NULL} };
static bool
ACK

On 17.01.2013 12:01, Guannan Ren wrote:
On 01/14/2013 11:59 PM, Michal Privoznik wrote:
--- tools/virsh-volume.c | 368 +++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 286 insertions(+), 82 deletions(-)
ACK
Thank you guys, I've pushed the whole patch set. Michal
participants (3)
-
Doug Goldstein
-
Guannan Ren
-
Michal Privoznik