diff options
author | Ian Campbell <ian.campbell@citrix.com> | 2010-08-24 18:29:21 +0100 |
---|---|---|
committer | Ian Campbell <ian.campbell@citrix.com> | 2010-08-24 18:29:21 +0100 |
commit | 763cad85585b22925912f38f94ed89e18e115920 (patch) | |
tree | 585ea7367f11bbf99db91bc2b8ba450003be9ff6 /tools/libxl/xl_cmdtable.c | |
parent | 86316089e4611c19d3b53c16f0ace532ef24a576 (diff) | |
download | xen-763cad85585b22925912f38f94ed89e18e115920.tar.gz xen-763cad85585b22925912f38f94ed89e18e115920.tar.bz2 xen-763cad85585b22925912f38f94ed89e18e115920.zip |
xl: correct argument parsing for some sub-commands.
XL sub-commands are expected to parse their arguments relative to the
global variable "optind" rather than treating argc+argv as zero
based. This is because the argc+argv passed to sub-commands include
the entire original command line, not just the sub command specific bits.
Not all commands do this and they are therefore broken if the user
uses "xl -v command", correct such problems
dump-core:
- did not handle "-h" option.
{network,network2,block}-{attach,list,detach} :
- handled arguments without reference to optind
- checked number of arguments before processing getopt loop,
breaking "-h" option handling
An example of the breakage:
# xl -v block-list d32-2
Vdev BE handle state evt-ch ring-ref BE-path
block-list is an invalid domain identifier
51712 0 1 4 13 8 /local/domain/0/backend/vbd/1/
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Diffstat (limited to 'tools/libxl/xl_cmdtable.c')
-rw-r--r-- | tools/libxl/xl_cmdtable.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/libxl/xl_cmdtable.c b/tools/libxl/xl_cmdtable.c index 73668be2f4..00d45c3ebc 100644 --- a/tools/libxl/xl_cmdtable.c +++ b/tools/libxl/xl_cmdtable.c @@ -241,7 +241,7 @@ struct cmd_spec cmd_table[] = { "Create a new virtual network device", "<Domain> [type=<type>] [mac=<mac>] [bridge=<bridge>] " "[ip=<ip>] [script=<script>] [backend=<BackDomain>] [vifname=<name>] " - "[rate=<rate>] [model=<model>][accel=<accel>]", + "[rate=<rate>] [model=<model>] [accel=<accel>]", }, { "network-list", &main_networklist, |