[libvirt] [PATCH 0/4] Various virsh cleanups and enhancements

Wanting to resolve rhbz#919372 (fixed in [3/4]) I came accross few things that could've used some polishing, so here's the series. Martin Kletzander (4): Make vshDebug work when parsing parameters Fix snapshot-create-as syntax in help output Allow multiple parameters for schedinfo Cleanup useless flags specifications tools/virsh-domain-monitor.c | 26 ---- tools/virsh-domain.c | 274 ++++--------------------------------------- tools/virsh-host.c | 10 -- tools/virsh-interface.c | 7 -- tools/virsh-network.c | 12 -- tools/virsh-nodedev.c | 3 - tools/virsh-pool.c | 23 ---- tools/virsh-secret.c | 4 - tools/virsh-snapshot.c | 61 +--------- tools/virsh-volume.c | 29 ----- tools/virsh.c | 13 +- 11 files changed, 29 insertions(+), 433 deletions(-) -- 1.8.1.5

The vshInit initializes ctl->debug by which vshDebug (which is also called in vshParseArgv) decides whether to print out the message or not. Signed-off-by: Martin Kletzander <mkletzan@redhat.com> --- tools/virsh.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tools/virsh.c b/tools/virsh.c index d822e09..9ed038a 100644 --- a/tools/virsh.c +++ b/tools/virsh.c @@ -3100,15 +3100,13 @@ main(int argc, char **argv) ctl->name = vshStrdup(ctl, defaultConn); } - if (!vshParseArgv(ctl, argc, argv)) { + if (!vshInit(ctl)) { vshDeinit(ctl); exit(EXIT_FAILURE); } - if (!vshInit(ctl)) { - vshDeinit(ctl); + if (!vshParseArgv(ctl, argc, argv)) exit(EXIT_FAILURE); - } if (!ctl->imode) { ret = vshCommandRun(ctl, ctl->cmd); -- 1.8.1.5

On Thu, Mar 14, 2013 at 10:27:32AM +0100, Martin Kletzander wrote:
The vshInit initializes ctl->debug by which vshDebug (which is also called in vshParseArgv) decides whether to print out the message or not.
Signed-off-by: Martin Kletzander <mkletzan@redhat.com> --- tools/virsh.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/tools/virsh.c b/tools/virsh.c index d822e09..9ed038a 100644 --- a/tools/virsh.c +++ b/tools/virsh.c @@ -3100,15 +3100,13 @@ main(int argc, char **argv) ctl->name = vshStrdup(ctl, defaultConn); }
- if (!vshParseArgv(ctl, argc, argv)) { + if (!vshInit(ctl)) { vshDeinit(ctl);
Hmm, we previously called vshDeinit() even though we'd not got to vshInit yet !
exit(EXIT_FAILURE); }
- if (!vshInit(ctl)) { - vshDeinit(ctl); + if (!vshParseArgv(ctl, argc, argv))
But here you've lost the vshDeinit now. I think we need to put that back to keep valgrind happy, don't we ? Or is there some reason which forced to you drop the vshDeinit here ?
exit(EXIT_FAILURE); - }
Regards Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|

On 03/14/2013 06:15 PM, Daniel P. Berrange wrote:
On Thu, Mar 14, 2013 at 10:27:32AM +0100, Martin Kletzander wrote:
The vshInit initializes ctl->debug by which vshDebug (which is also called in vshParseArgv) decides whether to print out the message or not.
Signed-off-by: Martin Kletzander <mkletzan@redhat.com> --- tools/virsh.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/tools/virsh.c b/tools/virsh.c index d822e09..9ed038a 100644 --- a/tools/virsh.c +++ b/tools/virsh.c @@ -3100,15 +3100,13 @@ main(int argc, char **argv) ctl->name = vshStrdup(ctl, defaultConn); }
- if (!vshParseArgv(ctl, argc, argv)) { + if (!vshInit(ctl)) { vshDeinit(ctl);
Hmm, we previously called vshDeinit() even though we'd not got to vshInit yet !
exit(EXIT_FAILURE); }
- if (!vshInit(ctl)) { - vshDeinit(ctl); + if (!vshParseArgv(ctl, argc, argv))
But here you've lost the vshDeinit now. I think we need to put that back to keep valgrind happy, don't we ? Or is there some reason which forced to you drop the vshDeinit here ?
No reason, just my fault. I removed it at first when the vshParseArgv was before vshInit and then switched those two without adding it back, thanks for noticing. This is how the patch should've looked like: diff --git a/tools/virsh.c b/tools/virsh.c index d822e09..58a604b 100644 --- a/tools/virsh.c +++ b/tools/virsh.c @@ -3100,12 +3100,12 @@ main(int argc, char **argv) ctl->name = vshStrdup(ctl, defaultConn); } - if (!vshParseArgv(ctl, argc, argv)) { + if (!vshInit(ctl)) { vshDeinit(ctl); exit(EXIT_FAILURE); } - if (!vshInit(ctl)) { + if (!vshParseArgv(ctl, argc, argv)) { vshDeinit(ctl); exit(EXIT_FAILURE); } --
exit(EXIT_FAILURE); - }
Regards Daniel

On Fri, Mar 15, 2013 at 02:10:08PM +0100, Martin Kletzander wrote:
On 03/14/2013 06:15 PM, Daniel P. Berrange wrote:
On Thu, Mar 14, 2013 at 10:27:32AM +0100, Martin Kletzander wrote:
The vshInit initializes ctl->debug by which vshDebug (which is also called in vshParseArgv) decides whether to print out the message or not.
Signed-off-by: Martin Kletzander <mkletzan@redhat.com> --- tools/virsh.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/tools/virsh.c b/tools/virsh.c index d822e09..9ed038a 100644 --- a/tools/virsh.c +++ b/tools/virsh.c @@ -3100,15 +3100,13 @@ main(int argc, char **argv) ctl->name = vshStrdup(ctl, defaultConn); }
- if (!vshParseArgv(ctl, argc, argv)) { + if (!vshInit(ctl)) { vshDeinit(ctl);
Hmm, we previously called vshDeinit() even though we'd not got to vshInit yet !
exit(EXIT_FAILURE); }
- if (!vshInit(ctl)) { - vshDeinit(ctl); + if (!vshParseArgv(ctl, argc, argv))
But here you've lost the vshDeinit now. I think we need to put that back to keep valgrind happy, don't we ? Or is there some reason which forced to you drop the vshDeinit here ?
No reason, just my fault. I removed it at first when the vshParseArgv was before vshInit and then switched those two without adding it back, thanks for noticing. This is how the patch should've looked like:
diff --git a/tools/virsh.c b/tools/virsh.c index d822e09..58a604b 100644 --- a/tools/virsh.c +++ b/tools/virsh.c @@ -3100,12 +3100,12 @@ main(int argc, char **argv) ctl->name = vshStrdup(ctl, defaultConn); }
- if (!vshParseArgv(ctl, argc, argv)) { + if (!vshInit(ctl)) { vshDeinit(ctl); exit(EXIT_FAILURE); }
- if (!vshInit(ctl)) { + if (!vshParseArgv(ctl, argc, argv)) { vshDeinit(ctl); exit(EXIT_FAILURE); }
ACK Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|

On 03/15/2013 02:17 PM, Daniel P. Berrange wrote:
On Fri, Mar 15, 2013 at 02:10:08PM +0100, Martin Kletzander wrote:
On 03/14/2013 06:15 PM, Daniel P. Berrange wrote:
On Thu, Mar 14, 2013 at 10:27:32AM +0100, Martin Kletzander wrote:
The vshInit initializes ctl->debug by which vshDebug (which is also called in vshParseArgv) decides whether to print out the message or not.
Signed-off-by: Martin Kletzander <mkletzan@redhat.com> --- [...] diff --git a/tools/virsh.c b/tools/virsh.c index d822e09..58a604b 100644 --- a/tools/virsh.c +++ b/tools/virsh.c @@ -3100,12 +3100,12 @@ main(int argc, char **argv) ctl->name = vshStrdup(ctl, defaultConn); }
- if (!vshParseArgv(ctl, argc, argv)) { + if (!vshInit(ctl)) { vshDeinit(ctl); exit(EXIT_FAILURE); }
- if (!vshInit(ctl)) { + if (!vshParseArgv(ctl, argc, argv)) { vshDeinit(ctl); exit(EXIT_FAILURE); }
ACK
Thanks, pushed Martin

According to the man page, the memspec parameter should have the '--memspec' option mandatory and this is as close as we can get to that. What this change does is explained below. man virsh: snapshot-create-as ... [[--live] [--memspec memspec]] virsh help snapshot-create-as before this patch: SYNOPSIS snapshot-create-as ... [<memspec>] ... ... OPTIONS [--memspec] <string> ... virsh help snapshot-create-as after this patch: SYNOPSIS snapshot-create-as ... [--memspec <string>] ... ... OPTIONS --memspec <string> ... Signed-off-by: Martin Kletzander <mkletzan@redhat.com> --- tools/virsh-snapshot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/virsh-snapshot.c b/tools/virsh-snapshot.c index d994fd9..c2db99b 100644 --- a/tools/virsh-snapshot.c +++ b/tools/virsh-snapshot.c @@ -397,7 +397,7 @@ static const vshCmdOptDef opts_snapshot_create_as[] = { .help = N_("take a live snapshot") }, {.name = "memspec", - .type = VSH_OT_DATA, + .type = VSH_OT_STRING, .flags = VSH_OFLAG_REQ_OPT, .help = N_("memory attributes: [file=]name[,snapshot=type]") }, -- 1.8.1.5

On Thu, Mar 14, 2013 at 10:27:33AM +0100, Martin Kletzander wrote:
According to the man page, the memspec parameter should have the '--memspec' option mandatory and this is as close as we can get to that. What this change does is explained below.
man virsh:
snapshot-create-as ... [[--live] [--memspec memspec]]
virsh help snapshot-create-as before this patch:
SYNOPSIS snapshot-create-as ... [<memspec>] ... ... OPTIONS [--memspec] <string> ...
virsh help snapshot-create-as after this patch:
SYNOPSIS snapshot-create-as ... [--memspec <string>] ... ... OPTIONS --memspec <string> ...
Signed-off-by: Martin Kletzander <mkletzan@redhat.com> --- tools/virsh-snapshot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/virsh-snapshot.c b/tools/virsh-snapshot.c index d994fd9..c2db99b 100644 --- a/tools/virsh-snapshot.c +++ b/tools/virsh-snapshot.c @@ -397,7 +397,7 @@ static const vshCmdOptDef opts_snapshot_create_as[] = { .help = N_("take a live snapshot") }, {.name = "memspec", - .type = VSH_OT_DATA, + .type = VSH_OT_STRING, .flags = VSH_OFLAG_REQ_OPT, .help = N_("memory attributes: [file=]name[,snapshot=type]") },
ACK, looks reasonable, but would like Eric to confirm since he did this bit of code. Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|

On 03/14/2013 11:16 AM, Daniel P. Berrange wrote:
On Thu, Mar 14, 2013 at 10:27:33AM +0100, Martin Kletzander wrote:
According to the man page, the memspec parameter should have the '--memspec' option mandatory and this is as close as we can get to that. What this change does is explained below.
diff --git a/tools/virsh-snapshot.c b/tools/virsh-snapshot.c index d994fd9..c2db99b 100644 --- a/tools/virsh-snapshot.c +++ b/tools/virsh-snapshot.c @@ -397,7 +397,7 @@ static const vshCmdOptDef opts_snapshot_create_as[] = { .help = N_("take a live snapshot") }, {.name = "memspec", - .type = VSH_OT_DATA, + .type = VSH_OT_STRING, .flags = VSH_OFLAG_REQ_OPT, .help = N_("memory attributes: [file=]name[,snapshot=type]") },
ACK, looks reasonable, but would like Eric to confirm since he did this bit of code.
Concur - this is a reasonable change. (I'm still not sure why we have VSH_OT_DATA vs. VSH_OT_STRING, as about the ONLY place where they make a difference is in help ouput.) -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On 03/14/2013 06:48 PM, Eric Blake wrote:
On 03/14/2013 11:16 AM, Daniel P. Berrange wrote:
On Thu, Mar 14, 2013 at 10:27:33AM +0100, Martin Kletzander wrote:
According to the man page, the memspec parameter should have the '--memspec' option mandatory and this is as close as we can get to that. What this change does is explained below.
diff --git a/tools/virsh-snapshot.c b/tools/virsh-snapshot.c index d994fd9..c2db99b 100644 --- a/tools/virsh-snapshot.c +++ b/tools/virsh-snapshot.c @@ -397,7 +397,7 @@ static const vshCmdOptDef opts_snapshot_create_as[] = { .help = N_("take a live snapshot") }, {.name = "memspec", - .type = VSH_OT_DATA, + .type = VSH_OT_STRING, .flags = VSH_OFLAG_REQ_OPT, .help = N_("memory attributes: [file=]name[,snapshot=type]") },
ACK, looks reasonable, but would like Eric to confirm since he did this bit of code.
Concur - this is a reasonable change.
(I'm still not sure why we have VSH_OT_DATA vs. VSH_OT_STRING, as about the ONLY place where they make a difference is in help ouput.)
Thanks, pushed. Martin

virsh schedinfo was able to set only one parameter at a time (not counting the deprecated options), but it is useful to set more at once, so this patch adds the possibility to do stuff like this: virsh schedinfo <domain> cpu_shares=0 vcpu_period=0 vcpu_quota=0 \ emulator_period=0 emulator_quota=0 Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=919372 Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=919375 Signed-off-by: Martin Kletzander <mkletzan@redhat.com> --- tools/virsh-domain.c | 55 ++++++++++++++++++++++++++-------------------------- 1 file changed, 27 insertions(+), 28 deletions(-) diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index ab90f58..a7cc9d5 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -4026,36 +4026,33 @@ static const vshCmdOptDef opts_schedinfo[] = { .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, + .flags = VSH_OFLAG_REQ_OPT, .help = N_("weight for XEN_CREDIT") }, {.name = "cap", .type = VSH_OT_INT, - .flags = VSH_OFLAG_NONE, + .flags = VSH_OFLAG_REQ_OPT, .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 = "set", + .type = VSH_OT_ARGV, + .flags = VSH_OFLAG_NONE, + .help = N_("parameter=value") + }, {.name = NULL} }; @@ -4064,9 +4061,9 @@ cmdSchedInfoUpdate(vshControl *ctl, const vshCmd *cmd, virTypedParameterPtr src_params, int nsrc_params, virTypedParameterPtr *update_params) { - const char *set_arg; char *set_field = NULL; char *set_val = NULL; + const vshCmdOpt *opt = NULL; virTypedParameterPtr param; virTypedParameterPtr params = NULL; int nparams = 0; @@ -4076,17 +4073,6 @@ cmdSchedInfoUpdate(vshControl *ctl, const vshCmd *cmd, int val; int i; - if (vshCommandOptString(cmd, "set", &set_arg) > 0) { - set_field = vshStrdup(ctl, set_arg); - if (!(set_val = strchr(set_field, '='))) { - vshError(ctl, "%s", _("Invalid syntax for --set, expecting name=value")); - goto cleanup; - } - - *set_val = '\0'; - set_val++; - } - for (i = 0; i < nsrc_params; i++) { param = &(src_params[i]); @@ -4108,15 +4094,28 @@ cmdSchedInfoUpdate(vshControl *ctl, const vshCmd *cmd, continue; } - if (set_field && STREQ(set_field, param->field)) { - if (virTypedParamsAddFromString(¶ms, &nparams, &maxparams, - set_field, param->type, - set_val) < 0) { - vshSaveLibvirtError(); + opt = NULL; + while ((opt = vshCommandOptArgv(cmd, opt))) { + set_field = vshStrdup(ctl, opt->data); + if (!(set_val = strchr(set_field, '='))) { + vshError(ctl, "%s", _("Invalid syntax for --set, expecting name=value")); goto cleanup; } - continue; + *set_val = '\0'; + set_val++; + + if (STREQ(set_field, param->field)) { + if (virTypedParamsAddFromString(¶ms, &nparams, &maxparams, + set_field, param->type, + set_val) < 0) { + vshSaveLibvirtError(); + goto cleanup; + } + VIR_FREE(set_field); + break; + } + VIR_FREE(set_field); } } -- 1.8.1.5

On 03/14/2013 03:27 AM, Martin Kletzander wrote:
virsh schedinfo was able to set only one parameter at a time (not counting the deprecated options), but it is useful to set more at once, so this patch adds the possibility to do stuff like this:
virsh schedinfo <domain> cpu_shares=0 vcpu_period=0 vcpu_quota=0 \ emulator_period=0 emulator_quota=0
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=919372 Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=919375
Signed-off-by: Martin Kletzander <mkletzan@redhat.com> --- tools/virsh-domain.c | 55 ++++++++++++++++++++++++++-------------------------- 1 file changed, 27 insertions(+), 28 deletions(-)
No change to tools/virsh.pod? I would have expected something like: =item B<schedinfo> I<domain> [[I<--config>] [I<--live>] | [I<--current>]] [I<--set> B<parameter=value>]...
+++ b/tools/virsh-domain.c @@ -4026,36 +4026,33 @@ static const vshCmdOptDef opts_schedinfo[] = { .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, + .flags = VSH_OFLAG_REQ_OPT, .help = N_("weight for XEN_CREDIT")
Previously, 'schedinfo domain 1' was parsed as --set=1, but then errored out because there was no '=' in the argument to set; a user doing weight in isolation had to do an explicit --weight=1 to skip the --set field. Now that you have re-ordered parameters, but used VSH_OFLAG_REQ_OPT on all parameters that got moved before set, a single argument still parses as --set, and the user still has to do an explicit --weight=1 to use the weight option instead. That's good - no semantic change for the single-argument case. For the multi-argument case: previously, 'schedinfo domain foo=bar 1' was parsed as --set=foo=bar --weight=1, now it will parse as --set=foo=bar --set=1 and error out. But I don't think that anyone was relying on mixing old and new syntax (the man page called out --weight on a different line than --set), so I can live with that change. Thus, even though I see a difference in parse, that difference is only on a case that users should not have been doing, and I'm happy with your patch. ACK, if you touch up virsh.pod to match. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On 03/14/2013 09:53 PM, Eric Blake wrote:
On 03/14/2013 03:27 AM, Martin Kletzander wrote:
virsh schedinfo was able to set only one parameter at a time (not counting the deprecated options), but it is useful to set more at once, so this patch adds the possibility to do stuff like this:
virsh schedinfo <domain> cpu_shares=0 vcpu_period=0 vcpu_quota=0 \ emulator_period=0 emulator_quota=0
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=919372 Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=919375
Signed-off-by: Martin Kletzander <mkletzan@redhat.com> --- tools/virsh-domain.c | 55 ++++++++++++++++++++++++++-------------------------- 1 file changed, 27 insertions(+), 28 deletions(-)
No change to tools/virsh.pod? I would have expected something like:
=item B<schedinfo> I<domain> [[I<--config>] [I<--live>] | [I<--current>]] [I<--set> B<parameter=value>]...
+++ b/tools/virsh-domain.c @@ -4026,36 +4026,33 @@ static const vshCmdOptDef opts_schedinfo[] = { .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, + .flags = VSH_OFLAG_REQ_OPT, .help = N_("weight for XEN_CREDIT")
Previously, 'schedinfo domain 1' was parsed as --set=1, but then errored out because there was no '=' in the argument to set; a user doing weight in isolation had to do an explicit --weight=1 to skip the --set field. Now that you have re-ordered parameters, but used VSH_OFLAG_REQ_OPT on all parameters that got moved before set, a single argument still parses as --set, and the user still has to do an explicit --weight=1 to use the weight option instead. That's good - no semantic change for the single-argument case.
For the multi-argument case: previously, 'schedinfo domain foo=bar 1' was parsed as --set=foo=bar --weight=1, now it will parse as --set=foo=bar --set=1 and error out. But I don't think that anyone was relying on mixing old and new syntax (the man page called out --weight on a different line than --set), so I can live with that change.
Thus, even though I see a difference in parse, that difference is only on a case that users should not have been doing, and I'm happy with your patch.
ACK, if you touch up virsh.pod to match.
Thanks for that, but I've found out one more inconsistency which is bothering me a bit (even though it was present there even before this patch), so I'll be sending a v2 for this one. This time with the manual fixed as well. Martin

After we switched to C99 initialization, I noticed there were many places where the specification of .flags parameter differed. After going through many options and deciding whether to unify the initialization to be '.flags = 0' or '.flags = VSH_OFLAG_NONE', I realized both can be removed and it makes the code easier to go through. Signed-off-by: Martin Kletzander <mkletzan@redhat.com> --- tools/virsh-domain-monitor.c | 26 ----- tools/virsh-domain.c | 221 ------------------------------------------- tools/virsh-host.c | 10 -- tools/virsh-interface.c | 7 -- tools/virsh-network.c | 12 --- tools/virsh-nodedev.c | 3 - tools/virsh-pool.c | 23 ----- tools/virsh-secret.c | 4 - tools/virsh-snapshot.c | 59 ------------ tools/virsh-volume.c | 29 ------ tools/virsh.c | 7 -- 11 files changed, 401 deletions(-) diff --git a/tools/virsh-domain-monitor.c b/tools/virsh-domain-monitor.c index 074b578..d34878f 100644 --- a/tools/virsh-domain-monitor.c +++ b/tools/virsh-domain-monitor.c @@ -425,12 +425,10 @@ static const vshCmdOptDef opts_domblklist[] = { }, {.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} @@ -541,7 +539,6 @@ static const vshCmdOptDef opts_domiflist[] = { }, {.name = "inactive", .type = VSH_OT_BOOL, - .flags = 0, .help = N_("get inactive rather than running configuration") }, {.name = NULL} @@ -652,12 +649,10 @@ static const vshCmdOptDef opts_domif_getlink[] = { }, {.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} @@ -848,7 +843,6 @@ static const vshCmdOptDef opts_domblkstat[] = { }, {.name = "human", .type = VSH_OT_BOOL, - .flags = 0, .help = N_("print a more human readable output") }, {.name = NULL} @@ -1311,7 +1305,6 @@ static const vshCmdOptDef opts_domstate[] = { }, {.name = "reason", .type = VSH_OT_BOOL, - .flags = 0, .help = N_("also print reason for the state") }, {.name = NULL} @@ -1638,97 +1631,78 @@ cleanup: static const vshCmdOptDef opts_list[] = { {.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} diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index a7cc9d5..4007481 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -175,12 +175,10 @@ static const vshCmdOptDef opts_attach_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} @@ -261,72 +259,58 @@ static const vshCmdOptDef opts_attach_disk[] = { }, {.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 = "print-xml", .type = VSH_OT_BOOL, - .flags = 0, .help = N_("print XML document rather than attach the disk") }, @@ -683,42 +667,34 @@ static const vshCmdOptDef opts_attach_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} @@ -914,7 +890,6 @@ static const vshCmdOptDef opts_autostart[] = { }, {.name = "disable", .type = VSH_OT_BOOL, - .flags = 0, .help = N_("disable autostarting") }, {.name = NULL} @@ -976,77 +951,62 @@ static const vshCmdOptDef opts_blkdeviotune[] = { }, {.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} @@ -1213,27 +1173,22 @@ static const vshCmdOptDef opts_blkiotune[] = { }, {.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} @@ -1491,42 +1446,34 @@ static const vshCmdOptDef opts_block_commit[] = { }, {.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} @@ -1679,52 +1626,42 @@ static const vshCmdOptDef opts_block_copy[] = { }, {.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} @@ -1886,27 +1823,22 @@ static const vshCmdOptDef opts_block_job[] = { }, {.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} @@ -1989,32 +1921,26 @@ static const vshCmdOptDef opts_block_pull[] = { }, {.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} @@ -2226,17 +2152,14 @@ static const vshCmdOptDef opts_console[] = { }, {.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} @@ -2336,12 +2259,10 @@ static const vshCmdOptDef opts_domif_setlink[] = { }, {.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} @@ -2527,27 +2448,22 @@ static const vshCmdOptDef opts_domiftune[] = { }, {.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} @@ -2898,28 +2814,23 @@ static const vshCmdOptDef opts_undefine[] = { }, {.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} @@ -3263,28 +3174,23 @@ static const vshCmdOptDef opts_start[] = { #ifndef WIN32 {.name = "console", .type = VSH_OT_BOOL, - .flags = 0, .help = N_("attach to console after creation") }, #endif {.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} @@ -3381,7 +3287,6 @@ static const vshCmdInfo info_save[] = { static const vshCmdOptDef opts_save[] = { {.name = "bypass-cache", .type = VSH_OT_BOOL, - .flags = 0, .help = N_("avoid file system cache when saving") }, {.name = "domain", @@ -3396,22 +3301,18 @@ static const vshCmdOptDef opts_save[] = { }, {.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} @@ -3637,7 +3538,6 @@ static const vshCmdOptDef opts_save_image_dumpxml[] = { }, {.name = "security-info", .type = VSH_OT_BOOL, - .flags = 0, .help = N_("include security sensitive information in XML dump") }, {.name = NULL} @@ -3695,12 +3595,10 @@ static const vshCmdOptDef opts_save_image_define[] = { }, {.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} @@ -3763,12 +3661,10 @@ static const vshCmdOptDef opts_save_image_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} @@ -3836,7 +3732,6 @@ static const vshCmdInfo info_managedsave[] = { static const vshCmdOptDef opts_managedsave[] = { {.name = "bypass-cache", .type = VSH_OT_BOOL, - .flags = 0, .help = N_("avoid file system cache when saving") }, {.name = "domain", @@ -3846,17 +3741,14 @@ static const vshCmdOptDef opts_managedsave[] = { }, {.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} @@ -4050,7 +3942,6 @@ static const vshCmdOptDef opts_schedinfo[] = { }, {.name = "set", .type = VSH_OT_ARGV, - .flags = VSH_OFLAG_NONE, .help = N_("parameter=value") }, {.name = NULL} @@ -4268,22 +4159,18 @@ static const vshCmdOptDef opts_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} @@ -4346,22 +4233,18 @@ static const vshCmdInfo info_dump[] = { static const vshCmdOptDef opts_dump[] = { {.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", @@ -4376,12 +4259,10 @@ static const vshCmdOptDef opts_dump[] = { }, {.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} @@ -4503,12 +4384,10 @@ static const vshCmdOptDef opts_screenshot[] = { }, {.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} @@ -4695,7 +4574,6 @@ static const vshCmdOptDef opts_shutdown[] = { }, {.name = "mode", .type = VSH_OT_STRING, - .flags = VSH_OFLAG_NONE, .help = N_("shutdown mode: acpi|agent") }, {.name = NULL} @@ -4782,7 +4660,6 @@ static const vshCmdOptDef opts_reboot[] = { }, {.name = "mode", .type = VSH_OT_STRING, - .flags = VSH_OFLAG_NONE, .help = N_("shutdown mode: acpi|agent") }, {.name = NULL} @@ -5152,7 +5029,6 @@ static const vshCmdInfo info_maxvcpus[] = { static const vshCmdOptDef opts_maxvcpus[] = { {.name = "type", .type = VSH_OT_STRING, - .flags = 0, .help = N_("domain type") }, {.name = NULL} @@ -5196,27 +5072,22 @@ static const vshCmdOptDef opts_vcpucount[] = { }, {.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} @@ -5532,7 +5403,6 @@ static const vshCmdOptDef opts_vcpupin[] = { }, {.name = "vcpu", .type = VSH_OT_INT, - .flags = 0, .help = N_("vcpu number") }, {.name = "cpulist", @@ -5542,17 +5412,14 @@ static const vshCmdOptDef opts_vcpupin[] = { }, {.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} @@ -5820,17 +5687,14 @@ static const vshCmdOptDef opts_emulatorpin[] = { }, {.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} @@ -6024,22 +5888,18 @@ static const vshCmdOptDef opts_setvcpus[] = { }, {.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} @@ -6349,17 +6209,14 @@ static const vshCmdOptDef opts_cpu_stats[] = { }, {.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}, @@ -6524,18 +6381,15 @@ static const vshCmdOptDef opts_create[] = { #ifndef WIN32 {.name = "console", .type = VSH_OT_BOOL, - .flags = 0, .help = N_("attach to console after creation") }, #endif {.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} @@ -6653,7 +6507,6 @@ static const vshCmdOptDef opts_destroy[] = { }, {.name = "graceful", .type = VSH_OT_BOOL, - .flags = VSH_OFLAG_NONE, .help = N_("terminate gracefully") }, {.name = NULL} @@ -6711,32 +6564,26 @@ static const vshCmdOptDef opts_desc[] = { }, {.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} @@ -7149,7 +6996,6 @@ static const vshCmdOptDef opts_setmem[] = { }, {.name = "kilobytes", .type = VSH_OT_ALIAS, - .flags = 0, .help = "size" }, {.name = "size", @@ -7159,17 +7005,14 @@ static const vshCmdOptDef opts_setmem[] = { }, {.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} @@ -7255,7 +7098,6 @@ static const vshCmdOptDef opts_setmaxmem[] = { }, {.name = "kilobytes", .type = VSH_OT_ALIAS, - .flags = 0, .help = "size" }, {.name = "size", @@ -7265,17 +7107,14 @@ static const vshCmdOptDef opts_setmaxmem[] = { }, {.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} @@ -7365,37 +7204,30 @@ static const vshCmdOptDef opts_memtune[] = { }, {.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} @@ -7576,27 +7408,22 @@ static const vshCmdOptDef opts_numatune[] = { }, {.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} @@ -7733,12 +7560,10 @@ static const vshCmdOptDef opts_qemu_monitor_command[] = { }, {.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", @@ -7890,12 +7715,10 @@ static const vshCmdOptDef opts_qemu_agent_command[] = { }, {.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", @@ -8124,22 +7947,18 @@ static const vshCmdOptDef opts_dumpxml[] = { }, {.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} @@ -8427,77 +8246,62 @@ static const vshCmdInfo info_migrate[] = { static const vshCmdOptDef opts_migrate[] = { {.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 = "compressed", .type = VSH_OT_BOOL, - .flags = 0, .help = N_("compress repeated pages during live migration") }, {.name = "domain", @@ -8512,22 +8316,18 @@ static const vshCmdOptDef opts_migrate[] = { }, {.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} @@ -8945,7 +8745,6 @@ static const vshCmdOptDef opts_domdisplay[] = { }, {.name = "include-password", .type = VSH_OT_BOOL, - .flags = VSH_OFLAG_NONE, .help = N_("includes the password into the connection URI if available") }, {.name = NULL} @@ -9431,12 +9230,10 @@ static const vshCmdOptDef opts_detach_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} @@ -9512,17 +9309,14 @@ static const vshCmdOptDef opts_update_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 = "force", .type = VSH_OT_BOOL, - .flags = 0, .help = N_("force device update") }, {.name = NULL} @@ -9599,17 +9393,14 @@ static const vshCmdOptDef opts_detach_interface[] = { }, {.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} @@ -9981,12 +9772,10 @@ static const vshCmdOptDef opts_detach_disk[] = { }, {.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} @@ -10133,43 +9922,35 @@ static const vshCmdOptDef opts_change_media[] = { }, {.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} @@ -10298,13 +10079,11 @@ static const vshCmdOptDef opts_domfstrim[] = { }, {.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} diff --git a/tools/virsh-host.c b/tools/virsh-host.c index 4345839..abeb098 100644 --- a/tools/virsh-host.c +++ b/tools/virsh-host.c @@ -89,7 +89,6 @@ static const vshCmdOptDef opts_connect[] = { }, {.name = "readonly", .type = VSH_OT_BOOL, - .flags = 0, .help = N_("read-only connection") }, {.name = NULL} @@ -145,12 +144,10 @@ static const vshCmdInfo info_freecell[] = { static const vshCmdOptDef opts_freecell[] = { {.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} @@ -358,12 +355,10 @@ static const vshCmdInfo info_nodecpustats[] = { static const vshCmdOptDef opts_node_cpustats[] = { {.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} @@ -495,7 +490,6 @@ static const vshCmdInfo info_nodememstats[] = { static const vshCmdOptDef opts_node_memstats[] = { {.name = "cell", .type = VSH_OT_INT, - .flags = 0, .help = N_("prints specified cell statistics only.") }, {.name = NULL} @@ -718,7 +712,6 @@ static const vshCmdInfo info_version[] = { static const vshCmdOptDef opts_version[] = { {.name = "daemon", .type = VSH_OT_BOOL, - .flags = VSH_OFLAG_NONE, .help = N_("report daemon version too") }, {.name = NULL} @@ -817,19 +810,16 @@ static const vshCmdInfo info_node_memory_tune[] = { static const vshCmdOptDef opts_node_memory_tune[] = { {.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} diff --git a/tools/virsh-interface.c b/tools/virsh-interface.c index 445ca17..c022e1d 100644 --- a/tools/virsh-interface.c +++ b/tools/virsh-interface.c @@ -325,12 +325,10 @@ static const vshCmdInfo info_interface_list[] = { static const vshCmdOptDef opts_interface_list[] = { {.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} @@ -464,7 +462,6 @@ static const vshCmdOptDef opts_interface_dumpxml[] = { }, {.name = "inactive", .type = VSH_OT_BOOL, - .flags = 0, .help = N_("show inactive defined XML") }, {.name = NULL} @@ -791,17 +788,14 @@ static const vshCmdOptDef opts_interface_bridge[] = { }, {.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} @@ -1025,7 +1019,6 @@ static const vshCmdOptDef opts_interface_unbridge[] = { }, {.name = "no-start", .type = VSH_OT_BOOL, - .flags = 0, .help = N_("don't start the un-slaved interface immediately (not recommended)") }, {.name = NULL} diff --git a/tools/virsh-network.c b/tools/virsh-network.c index a62dee3..bc1a64a 100644 --- a/tools/virsh-network.c +++ b/tools/virsh-network.c @@ -99,7 +99,6 @@ static const vshCmdOptDef opts_network_autostart[] = { }, {.name = "disable", .type = VSH_OT_BOOL, - .flags = 0, .help = N_("disable autostarting") }, {.name = NULL} @@ -299,7 +298,6 @@ static const vshCmdOptDef opts_network_dumpxml[] = { }, {.name = "inactive", .type = VSH_OT_BOOL, - .flags = VSH_OFLAG_NONE, .help = N_("network information of an inactive domain") }, {.name = NULL} @@ -631,32 +629,26 @@ static const vshCmdInfo info_network_list[] = { static const vshCmdOptDef opts_network_list[] = { {.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} @@ -881,22 +873,18 @@ static const vshCmdOptDef opts_network_update[] = { }, {.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} diff --git a/tools/virsh-nodedev.c b/tools/virsh-nodedev.c index 0a7fe78..394208e 100644 --- a/tools/virsh-nodedev.c +++ b/tools/virsh-nodedev.c @@ -110,7 +110,6 @@ static const vshCmdInfo info_node_device_destroy[] = { static const vshCmdOptDef opts_node_device_destroy[] = { {.name = "name", .type = VSH_OT_ALIAS, - .flags = 0, .help = "device" }, {.name = "device", @@ -381,12 +380,10 @@ static const vshCmdInfo info_node_list_devices[] = { static const vshCmdOptDef opts_node_list_devices[] = { {.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} diff --git a/tools/virsh-pool.c b/tools/virsh-pool.c index a46cad1..c1e91ea 100644 --- a/tools/virsh-pool.c +++ b/tools/virsh-pool.c @@ -95,7 +95,6 @@ static const vshCmdOptDef opts_pool_autostart[] = { }, {.name = "disable", .type = VSH_OT_BOOL, - .flags = 0, .help = N_("disable autostarting") }, {.name = NULL} @@ -192,7 +191,6 @@ static const vshCmdOptDef opts_pool_X_as[] = { }, {.name = "print-xml", .type = VSH_OT_BOOL, - .flags = 0, .help = N_("print XML document, but don't define/create") }, {.name = "type", @@ -202,32 +200,26 @@ static const vshCmdOptDef opts_pool_X_as[] = { }, {.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} @@ -451,12 +443,10 @@ static const vshCmdOptDef opts_pool_build[] = { }, {.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} @@ -643,7 +633,6 @@ static const vshCmdOptDef opts_pool_dumpxml[] = { }, {.name = "inactive", .type = VSH_OT_BOOL, - .flags = 0, .help = N_("show inactive defined XML") }, {.name = NULL} @@ -916,42 +905,34 @@ static const vshCmdInfo info_pool_list[] = { static const vshCmdOptDef opts_pool_list[] = { {.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} @@ -1375,17 +1356,14 @@ static const vshCmdOptDef opts_find_storage_pool_sources_as[] = { }, {.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} @@ -1464,7 +1442,6 @@ static const vshCmdOptDef opts_find_storage_pool_sources[] = { }, {.name = "srcSpec", .type = VSH_OT_DATA, - .flags = VSH_OFLAG_NONE, .help = N_("optional file of source xml to query for pools") }, {.name = NULL} diff --git a/tools/virsh-secret.c b/tools/virsh-secret.c index 6329110..ea0b0c3 100644 --- a/tools/virsh-secret.c +++ b/tools/virsh-secret.c @@ -487,22 +487,18 @@ static const vshCmdInfo info_secret_list[] = { static const vshCmdOptDef opts_secret_list[] = { {.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} diff --git a/tools/virsh-snapshot.c b/tools/virsh-snapshot.c index c2db99b..844779d 100644 --- a/tools/virsh-snapshot.c +++ b/tools/virsh-snapshot.c @@ -129,52 +129,42 @@ static const vshCmdOptDef opts_snapshot_create[] = { }, {.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} @@ -348,52 +338,42 @@ static const vshCmdOptDef opts_snapshot_create_as[] = { }, {.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", @@ -403,7 +383,6 @@ static const vshCmdOptDef opts_snapshot_create_as[] = { }, {.name = "diskspec", .type = VSH_OT_ARGV, - .flags = 0, .help = N_("disk attributes: disk[,snapshot=type][,driver=type][,file=name]") }, {.name = NULL} @@ -551,22 +530,18 @@ static const vshCmdOptDef opts_snapshot_edit[] = { }, {.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} @@ -683,17 +658,14 @@ static const vshCmdOptDef opts_snapshot_current[] = { }, {.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} @@ -926,12 +898,10 @@ static const vshCmdOptDef opts_snapshot_info[] = { }, {.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} @@ -1485,82 +1455,66 @@ static const vshCmdOptDef opts_snapshot_list[] = { }, {.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 = "name", .type = VSH_OT_BOOL, - .flags = 0, .help = N_("list snapshot names only") }, @@ -1800,7 +1754,6 @@ static const vshCmdOptDef opts_snapshot_dumpxml[] = { }, {.name = "security-info", .type = VSH_OT_BOOL, - .flags = 0, .help = N_("include security sensitive information in XML dump") }, {.name = NULL} @@ -1864,12 +1817,10 @@ static const vshCmdOptDef opts_snapshot_parent[] = { }, {.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} @@ -1934,27 +1885,22 @@ static const vshCmdOptDef opts_snapshot_revert[] = { }, {.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} @@ -2032,27 +1978,22 @@ static const vshCmdOptDef opts_snapshot_delete[] = { }, {.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} diff --git a/tools/virsh-volume.c b/tools/virsh-volume.c index 4cff391..89ad8ea 100644 --- a/tools/virsh-volume.c +++ b/tools/virsh-volume.c @@ -132,27 +132,22 @@ static const vshCmdOptDef opts_vol_create_as[] = { }, {.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} @@ -332,7 +327,6 @@ static const vshCmdOptDef opts_vol_create[] = { }, {.name = "prealloc-metadata", .type = VSH_OT_BOOL, - .flags = 0, .help = N_("preallocate metadata (for qcow2 instead of full allocation)") }, {.name = NULL} @@ -408,12 +402,10 @@ static const vshCmdOptDef opts_vol_create_from[] = { }, {.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} @@ -523,12 +515,10 @@ static const vshCmdOptDef opts_vol_clone[] = { }, {.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} @@ -621,17 +611,14 @@ static const vshCmdOptDef opts_vol_upload[] = { }, {.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} @@ -738,17 +725,14 @@ static const vshCmdOptDef opts_vol_download[] = { }, {.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} @@ -848,7 +832,6 @@ static const vshCmdOptDef opts_vol_delete[] = { }, {.name = "pool", .type = VSH_OT_STRING, - .flags = 0, .help = N_("pool name or uuid") }, {.name = NULL} @@ -897,12 +880,10 @@ static const vshCmdOptDef opts_vol_wipe[] = { }, {.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} @@ -975,7 +956,6 @@ static const vshCmdOptDef opts_vol_info[] = { }, {.name = "pool", .type = VSH_OT_STRING, - .flags = 0, .help = N_("pool name or uuid") }, {.name = NULL} @@ -1056,22 +1036,18 @@ static const vshCmdOptDef opts_vol_resize[] = { }, {.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} @@ -1158,7 +1134,6 @@ static const vshCmdOptDef opts_vol_dumpxml[] = { }, {.name = "pool", .type = VSH_OT_STRING, - .flags = 0, .help = N_("pool name or uuid") }, {.name = NULL} @@ -1332,7 +1307,6 @@ static const vshCmdOptDef opts_vol_list[] = { }, {.name = "details", .type = VSH_OT_BOOL, - .flags = 0, .help = N_("display extended details for volumes") }, {.name = NULL} @@ -1644,7 +1618,6 @@ static const vshCmdInfo info_vol_pool[] = { static const vshCmdOptDef opts_vol_pool[] = { {.name = "uuid", .type = VSH_OT_BOOL, - .flags = 0, .help = N_("return the pool uuid rather than pool name") }, {.name = "vol", @@ -1713,7 +1686,6 @@ static const vshCmdOptDef opts_vol_key[] = { }, {.name = "pool", .type = VSH_OT_STRING, - .flags = 0, .help = N_("pool name or uuid") }, {.name = NULL} @@ -1753,7 +1725,6 @@ static const vshCmdOptDef opts_vol_path[] = { }, {.name = "pool", .type = VSH_OT_STRING, - .flags = 0, .help = N_("pool name or uuid") }, {.name = NULL} diff --git a/tools/virsh.c b/tools/virsh.c index 9ed038a..c12832c 100644 --- a/tools/virsh.c +++ b/tools/virsh.c @@ -453,7 +453,6 @@ static const vshCmdInfo info_help[] = { static const vshCmdOptDef opts_help[] = { {.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} @@ -717,7 +716,6 @@ static const vshCmdInfo info_cd[] = { static const vshCmdOptDef opts_cd[] = { {.name = "dir", .type = VSH_OT_DATA, - .flags = 0, .help = N_("directory to switch to (default: home or else root)") }, {.name = NULL} @@ -801,22 +799,18 @@ static const vshCmdInfo info_echo[] = { static const vshCmdOptDef opts_echo[] = { {.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} @@ -975,7 +969,6 @@ vshCmddefOptParse(const vshCmdDef *cmd, uint32_t *opts_need_arg, static vshCmdOptDef helpopt = { .name = "help", .type = VSH_OT_BOOL, - .flags = 0, .help = N_("print help for this function") }; static const vshCmdOptDef * -- 1.8.1.5

On Thu, Mar 14, 2013 at 10:27:35AM +0100, Martin Kletzander wrote:
After we switched to C99 initialization, I noticed there were many places where the specification of .flags parameter differed. After going through many options and deciding whether to unify the initialization to be '.flags = 0' or '.flags = VSH_OFLAG_NONE', I realized both can be removed and it makes the code easier to go through.
Signed-off-by: Martin Kletzander <mkletzan@redhat.com> --- tools/virsh-domain-monitor.c | 26 ----- tools/virsh-domain.c | 221 ------------------------------------------- tools/virsh-host.c | 10 -- tools/virsh-interface.c | 7 -- tools/virsh-network.c | 12 --- tools/virsh-nodedev.c | 3 - tools/virsh-pool.c | 23 ----- tools/virsh-secret.c | 4 - tools/virsh-snapshot.c | 59 ------------ tools/virsh-volume.c | 29 ------ tools/virsh.c | 7 -- 11 files changed, 401 deletions(-)
ACK Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|

On 03/14/2013 06:25 PM, Daniel P. Berrange wrote:
On Thu, Mar 14, 2013 at 10:27:35AM +0100, Martin Kletzander wrote:
After we switched to C99 initialization, I noticed there were many places where the specification of .flags parameter differed. After going through many options and deciding whether to unify the initialization to be '.flags = 0' or '.flags = VSH_OFLAG_NONE', I realized both can be removed and it makes the code easier to go through.
Signed-off-by: Martin Kletzander <mkletzan@redhat.com> --- tools/virsh-domain-monitor.c | 26 ----- tools/virsh-domain.c | 221 ------------------------------------------- tools/virsh-host.c | 10 -- tools/virsh-interface.c | 7 -- tools/virsh-network.c | 12 --- tools/virsh-nodedev.c | 3 - tools/virsh-pool.c | 23 ----- tools/virsh-secret.c | 4 - tools/virsh-snapshot.c | 59 ------------ tools/virsh-volume.c | 29 ------ tools/virsh.c | 7 -- 11 files changed, 401 deletions(-)
ACK
Thanks, pushed. Martin
participants (3)
-
Daniel P. Berrange
-
Eric Blake
-
Martin Kletzander