[libvirt] libvirt 0.5.1 tag missing in git repo: just applied manually
by Jim Meyering
FYI,
Itamar Heim noticed that the LIBVIRT_0_5_1 tag, while in CVS, was not
in the git repository (thanks, Itamar).
I have a vague recollection that git cvsimport creates certain tags lazily
(like only once there is something on a branch) but I have manually
applied and pushed this particular tag, nonetheless.
15 years, 10 months
[libvirt] [PATCH 0/4] generate SYNTAX section of "virsh help CMD" output
by Jim Meyering
This started when I noticed that a lot of virsh help output was
out of date. Dan Berrange suggested to generate the SYNTAX line
automatically based on existing option descriptions, since they tell us
what arguments/types each command accepts and can (usually) tell us when
options or arguments are optional.
Doing this exposed several inaccurate SYNTAX lines,
as well as some inaccurate option descriptions. But since
the option description structs are currently used only
to generate the text of ./virsh help's OPTIONS section,
it's not terribly important.
Other than changes to help output, this change induces some
minor user-visible changes:
It is currently undocumented that virsh accepts "-h C1 C2 C3..."
and treats it like "virsh help C1", ignoring C2 C3...
This change disables that feature (to clean up a few interfaces and to
make automatic help SYNTAX generation simpler) and makes virsh diagnose
any unused arguments with --help (-h), so now, this command fails rather
than trying to interpret "A" as a command:
$ virsh -h -c test:///default A
virsh: error: extra argument 'A'. See --help.
To view the other changes induced by this patch, I've run the
following commands:
v='virsh -c test:///default'
cmd=$(eval $v help|sed -n 's/^ \([^ ][^ ]*\) .*/\1/p')
for i in $(echo $cmd); do
diff -ubBw -L $i.orig -L $i.new <(eval $v help $i) <(eval ./$v help $i)
done
They use diff to compare e.g., the output of my just-built ./virsh
and the installed-in-PATH "virsh" program.
Note that there is currently no way via options to indicate that one
of two or more options must be selected, so the automatically generated
syntax string list both as independent options.
Here are the induced help changes:
[code diffs coming in separate messages]
--- attach-disk.orig
+++ attach-disk.new
@@ -2,7 +2,7 @@
attach-disk - attach disk device
SYNOPSIS
- attach-disk <domain> <source> <target> [--driver <driver>] [--subdriver <subdriver>] [--type <type>] [--mode <mode>]
+ attach-disk <domain> <source> <target> [--driver <string>] [--subdriver <string>] [--type <string>] [--mode <string>]
DESCRIPTION
Attach new disk device.
@@ -11,9 +11,9 @@
<domain> domain name, id or uuid
<source> source of disk device
<target> target of disk device
- <driver> driver of disk device
- <subdriver> subdriver of disk device
- <type> target device type
- <mode> mode of device reading and writing
+ --driver <string> driver of disk device
+ --subdriver <string> subdriver of disk device
+ --type <string> target device type
+ --mode <string> mode of device reading and writing
--- attach-interface.orig
+++ attach-interface.new
@@ -2,7 +2,7 @@
attach-interface - attach network interface
SYNOPSIS
- attach-interface <domain> <type> <source> [--target <target>] [--mac <mac>] [--script <script>]
+ attach-interface <domain> <type> <source> [<target>] [<mac>] [<script>]
DESCRIPTION
Attach new network interface.
--- autostart.orig
+++ autostart.new
@@ -2,7 +2,7 @@
autostart - autostart a domain
SYNOPSIS
- autostart [--disable] <domain>
+ autostart <domain> [--disable]
DESCRIPTION
Configure a domain to be automatically started at boot.
--- connect.orig
+++ connect.new
@@ -2,7 +2,7 @@
connect - (re)connect to hypervisor
SYNOPSIS
- connect [name] [--readonly]
+ connect [<name>] [--readonly]
DESCRIPTION
Connect to local hypervisor. This is built-in command after shell start up.
--- create.orig
+++ create.new
@@ -2,7 +2,7 @@
create - create a domain from an XML file
SYNOPSIS
- create a domain from an XML <file>
+ create <file>
DESCRIPTION
Create a domain.
--- start.orig
+++ start.new
@@ -8,6 +8,6 @@
Start a domain.
OPTIONS
- <name> name of the inactive domain
+ <domain> name of the inactive domain
--- detach-interface.orig
+++ detach-interface.new
@@ -2,7 +2,7 @@
detach-interface - detach network interface
SYNOPSIS
- detach-interface <domain> <type> [--mac <mac>]
+ detach-interface <domain> <type> [--mac <string>]
DESCRIPTION
Detach network interface.
@@ -10,6 +10,6 @@
OPTIONS
<domain> domain name, id or uuid
<type> network interface type
- <mac> MAC address
+ --mac <string> MAC address
--- define.orig
+++ define.new
@@ -2,7 +2,7 @@
define - define (but don't start) a domain from an XML file
SYNOPSIS
- define a domain from an XML <file>
+ define <file>
DESCRIPTION
Define a domain.
--- domblkstat.orig
+++ domblkstat.new
@@ -2,7 +2,7 @@
domblkstat - get device block stats for a domain
SYNOPSIS
- domblkstat <domain> <dev>
+ domblkstat <domain> <device>
DESCRIPTION
Get device block stats for a running domain.
--- domifstat.orig
+++ domifstat.new
@@ -2,7 +2,7 @@
domifstat - get network interface stats for a domain
SYNOPSIS
- domifstat <domain> <dev>
+ domifstat <domain> <interface>
DESCRIPTION
Get network interface stats for a running domain.
--- find-storage-pool-sources.orig
+++ find-storage-pool-sources.new
@@ -2,7 +2,7 @@
find-storage-pool-sources - discover potential storage pool sources
SYNOPSIS
- find-storage-pool-sources <type> [srcSpec]
+ find-storage-pool-sources <type> [<srcSpec>]
DESCRIPTION
Returns XML <sources> document.
--- find-storage-pool-sources-as.orig
+++ find-storage-pool-sources-as.new
@@ -2,7 +2,7 @@
find-storage-pool-sources-as - find potential storage pool sources
SYNOPSIS
- find-storage-pool-sources-as <type> [options]
+ find-storage-pool-sources-as <type> [<host>] [<port>]
DESCRIPTION
Returns XML <sources> document.
--- list.orig
+++ list.new
@@ -2,7 +2,7 @@
list - list domains
SYNOPSIS
- list [--inactive | --all]
+ list [--inactive] [--all]
DESCRIPTION
Returns list of domains.
--- migrate.orig
+++ migrate.new
@@ -2,7 +2,7 @@
migrate - migrate domain to another host
SYNOPSIS
- migrate [--live] <domain> <desturi> [<migrateuri>]
+ migrate [--live] <domain> <desturi> [<migrateuri>] [<dname>]
DESCRIPTION
Migrate domain to another host. Add --live for live migration.
--- net-autostart.orig
+++ net-autostart.new
@@ -2,7 +2,7 @@
net-autostart - autostart a network
SYNOPSIS
- net-autostart [--disable] <network>
+ net-autostart <network> [--disable]
DESCRIPTION
Configure a network to be automatically started at boot.
--- net-list.orig
+++ net-list.new
@@ -2,7 +2,7 @@
net-list - list networks
SYNOPSIS
- net-list [ --inactive | --all ]
+ net-list [--inactive] [--all]
DESCRIPTION
Returns list of networks.
--- net-start.orig
+++ net-start.new
@@ -2,7 +2,7 @@
net-start - start a (previously defined) inactive network
SYNOPSIS
- net-start <network>
+ net-start <name>
DESCRIPTION
Start a network.
--- nodedev-list.orig
+++ nodedev-list.new
@@ -2,7 +2,7 @@
nodedev-list - enumerate devices on this host
SYNOPSIS
- nodedev-list [--cap <capability>]
+ nodedev-list [--cap <string>]
OPTIONS
--cap <string> capability name
--- pool-autostart.orig
+++ pool-autostart.new
@@ -2,7 +2,7 @@
pool-autostart - autostart a pool
SYNOPSIS
- pool-autostart [--disable] <pool>
+ pool-autostart <pool> [--disable]
DESCRIPTION
Configure a pool to be automatically started at boot.
--- pool-create-as.orig
+++ pool-create-as.new
@@ -2,7 +2,7 @@
pool-create-as - create a pool from a set of args
SYNOPSIS
- pool-create-as <name> <type>
+ pool-create-as <name> <type> [<source-host>] [<source-path>] [<source-dev>] [<target>]
DESCRIPTION
Create a pool.
--- pool-define-as.orig
+++ pool-define-as.new
@@ -2,7 +2,7 @@
pool-define-as - define a pool from a set of args
SYNOPSIS
- pool-define-as <name> <type>
+ pool-define-as <name> <type> [<source-host>] [<source-path>] [<source-dev>] [<source-name>] [<target>]
DESCRIPTION
Define a pool.
--- pool-edit.orig
+++ pool-edit.new
@@ -2,7 +2,7 @@
pool-edit - edit XML configuration for a storage pool
SYNOPSIS
- pool-edit <domain>
+ pool-edit <pool>
DESCRIPTION
Edit the XML configuration for a storage pool.
--- pool-list.orig
+++ pool-list.new
@@ -2,7 +2,7 @@
pool-list - list pools
SYNOPSIS
- pool-list [ --inactive | --all ]
+ pool-list [--inactive] [--all]
DESCRIPTION
Returns list of pools.
--- pool-start.orig
+++ pool-start.new
@@ -8,6 +8,6 @@
Start a pool.
OPTIONS
- <name> name of the inactive pool
+ <pool> name of the inactive pool
--- restore.orig
+++ restore.new
@@ -2,7 +2,7 @@
restore - restore a domain from a saved state in a file
SYNOPSIS
- restore a domain from <file>
+ restore <file>
DESCRIPTION
Restore a domain.
--- schedinfo.orig
+++ schedinfo.new
@@ -2,7 +2,7 @@
schedinfo - show/set scheduler parameters
SYNOPSIS
- schedinfo <domain>
+ schedinfo <domain> [--set <string>] [--weight <number>] [--cap <number>]
DESCRIPTION
Show/Set scheduler parameters.
--- vol-create.orig
+++ vol-create.new
@@ -2,7 +2,7 @@
vol-create - create a vol from an XML file
SYNOPSIS
- vol-create <file>
+ vol-create <pool> <file>
DESCRIPTION
Create a vol.
--- vol-create-as.orig
+++ vol-create-as.new
@@ -2,7 +2,7 @@
vol-create-as - create a volume from a set of args
SYNOPSIS
- vol-create-as <pool> <name> <capacity>
+ vol-create-as <pool> <name> <capacity> [--allocation <string>] [--format <string>]
DESCRIPTION
Create a vol.
@@ -11,7 +11,7 @@
<pool> pool name
<name> name of the volume
<capacity> size of the vol with optional k,M,G,T suffix
- <allocation> initial allocation size with optional k,M,G,T suffix
- <format> file format type raw,bochs,qcow,qcow2,vmdk
+ --allocation <string> initial allocation size with optional k,M,G,T suffix
+ --format <string> file format type raw,bochs,qcow,qcow2,vmdk
--- vol-delete.orig
+++ vol-delete.new
@@ -2,7 +2,7 @@
vol-delete - delete a vol
SYNOPSIS
- vol-delete <vol>
+ vol-delete [--pool <string>] <vol>
DESCRIPTION
Delete a given vol.
--- vol-dumpxml.orig
+++ vol-dumpxml.new
@@ -2,7 +2,7 @@
vol-dumpxml - vol information in XML
SYNOPSIS
- vol-dumpxml <vol>
+ vol-dumpxml [--pool <string>] <vol>
DESCRIPTION
Output the vol information as an XML dump to stdout.
--- vol-info.orig
+++ vol-info.new
@@ -2,7 +2,7 @@
vol-info - storage vol information
SYNOPSIS
- vol-info <vol>
+ vol-info [--pool <string>] <vol>
DESCRIPTION
Returns basic information about the storage vol.
--- vol-path.orig
+++ vol-path.new
@@ -2,7 +2,7 @@
vol-path - convert a vol UUID to vol path
SYNOPSIS
- vol-path <pool> <vol>
+ vol-path [--pool <string>] <vol>
OPTIONS
--pool <string> pool name or uuid
15 years, 10 months
[libvirt] Bridged network (shared physical device) and libvirt
by Henrik Persson E
Hi,
Are there any plans to include possibility to configure bridged networks
in libvirt?
I see the need to be able to actually be able create vlans on physical
devices and the bridge the vlan, which I guess is a very normal case for
isolating network traffic between different guests.
I would be great if it would be possible to both create vlans on
physical devices and then also create bridged network connected to any
available network (physical/bonded/vlan)
/Henrik
15 years, 10 months
[libvirt] [PATCH 3/4] virsh.c: remove all "syntax" vshCmdInfo entries.
by Jim Meyering
* src/virsh.c: ... now that it's generated.
---
FYI, I made this change with the following one-liner:
perl -ni -e '/"syntax",/ or print' src/virsh.c
src/virsh.c | 89 -----------------------------------------------------------
1 files changed, 0 insertions(+), 89 deletions(-)
diff --git a/src/virsh.c b/src/virsh.c
index d96a7d4..230a128 100644
--- a/src/virsh.c
+++ b/src/virsh.c
@@ -335,7 +335,6 @@ static int namesorter(const void *a, const void *b) {
* "help" command
*/
static const vshCmdInfo info_help[] = {
- {"syntax", "help [<command>]"},
{"help", gettext_noop("print help")},
{"desc", gettext_noop("Prints global help or command specific help.")},
@@ -368,7 +367,6 @@ cmdHelp(vshControl *ctl, const vshCmd *cmd)
* "autostart" command
*/
static const vshCmdInfo info_autostart[] = {
- {"syntax", "autostart [--disable] <domain>"},
{"help", gettext_noop("autostart a domain")},
{"desc",
gettext_noop("Configure a domain to be automatically started at boot.")},
@@ -420,7 +418,6 @@ cmdAutostart(vshControl *ctl, const vshCmd *cmd)
* "connect" command
*/
static const vshCmdInfo info_connect[] = {
- {"syntax", "connect [name] [--readonly]"},
{"help", gettext_noop("(re)connect to hypervisor")},
{"desc",
gettext_noop("Connect to local hypervisor. This is built-in command after shell start up.")},
@@ -468,7 +465,6 @@ cmdConnect(vshControl *ctl, const vshCmd *cmd)
* "console" command
*/
static const vshCmdInfo info_console[] = {
- {"syntax", "console <domain>"},
{"help", gettext_noop("connect to the guest console")},
{"desc",
gettext_noop("Connect the virtual serial console for the guest")},
@@ -545,7 +541,6 @@ cmdConsole(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED)
* "list" command
*/
static const vshCmdInfo info_list[] = {
- {"syntax", "list [--inactive | --all]"},
{"help", gettext_noop("list domains")},
{"desc", gettext_noop("Returns list of domains.")},
{NULL, NULL}
@@ -663,7 +658,6 @@ cmdList(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED)
* "domstate" command
*/
static const vshCmdInfo info_domstate[] = {
- {"syntax", "domstate <domain>"},
{"help", gettext_noop("domain state")},
{"desc", gettext_noop("Returns state about a domain.")},
{NULL, NULL}
@@ -700,7 +694,6 @@ cmdDomstate(vshControl *ctl, const vshCmd *cmd)
/* "domblkstat" command
*/
static const vshCmdInfo info_domblkstat[] = {
- {"syntax", "domblkstat <domain> <dev>"},
{"help", gettext_noop("get device block stats for a domain")},
{"desc", gettext_noop("Get device block stats for a running domain.")},
{NULL,NULL}
@@ -757,7 +750,6 @@ cmdDomblkstat (vshControl *ctl, const vshCmd *cmd)
/* "domifstat" command
*/
static const vshCmdInfo info_domifstat[] = {
- {"syntax", "domifstat <domain> <dev>"},
{"help", gettext_noop("get network interface stats for a domain")},
{"desc", gettext_noop("Get network interface stats for a running domain.")},
{NULL,NULL}
@@ -824,7 +816,6 @@ cmdDomIfstat (vshControl *ctl, const vshCmd *cmd)
* "suspend" command
*/
static const vshCmdInfo info_suspend[] = {
- {"syntax", "suspend <domain>"},
{"help", gettext_noop("suspend a domain")},
{"desc", gettext_noop("Suspend a running domain.")},
{NULL, NULL}
@@ -863,7 +854,6 @@ cmdSuspend(vshControl *ctl, const vshCmd *cmd)
* "create" command
*/
static const vshCmdInfo info_create[] = {
- {"syntax", "create a domain from an XML <file>"},
{"help", gettext_noop("create a domain from an XML file")},
{"desc", gettext_noop("Create a domain.")},
{NULL, NULL}
@@ -911,7 +901,6 @@ cmdCreate(vshControl *ctl, const vshCmd *cmd)
* "define" command
*/
static const vshCmdInfo info_define[] = {
- {"syntax", "define a domain from an XML <file>"},
{"help", gettext_noop("define (but don't start) a domain from an XML file")},
{"desc", gettext_noop("Define a domain.")},
{NULL, NULL}
@@ -959,7 +948,6 @@ cmdDefine(vshControl *ctl, const vshCmd *cmd)
* "undefine" command
*/
static const vshCmdInfo info_undefine[] = {
- {"syntax", "undefine <domain>"},
{"help", gettext_noop("undefine an inactive domain")},
{"desc", gettext_noop("Undefine the configuration for an inactive domain.")},
{NULL, NULL}
@@ -1014,7 +1002,6 @@ cmdUndefine(vshControl *ctl, const vshCmd *cmd)
* "start" command
*/
static const vshCmdInfo info_start[] = {
- {"syntax", "start <domain>"},
{"help", gettext_noop("start a (previously defined) inactive domain")},
{"desc", gettext_noop("Start a domain.")},
{NULL, NULL}
@@ -1059,7 +1046,6 @@ cmdStart(vshControl *ctl, const vshCmd *cmd)
* "save" command
*/
static const vshCmdInfo info_save[] = {
- {"syntax", "save <domain> <file>"},
{"help", gettext_noop("save a domain state to a file")},
{"desc", gettext_noop("Save a running domain.")},
{NULL, NULL}
@@ -1103,7 +1089,6 @@ cmdSave(vshControl *ctl, const vshCmd *cmd)
* "schedinfo" command
*/
static const vshCmdInfo info_schedinfo[] = {
- {"syntax", "schedinfo <domain>"},
{"help", gettext_noop("show/set scheduler parameters")},
{"desc", gettext_noop("Show/Set scheduler parameters.")},
{NULL, NULL}
@@ -1286,7 +1271,6 @@ cmdSchedinfo(vshControl *ctl, const vshCmd *cmd)
* "restore" command
*/
static const vshCmdInfo info_restore[] = {
- {"syntax", "restore a domain from <file>"},
{"help", gettext_noop("restore a domain from a saved state in a file")},
{"desc", gettext_noop("Restore a domain.")},
{NULL, NULL}
@@ -1324,7 +1308,6 @@ cmdRestore(vshControl *ctl, const vshCmd *cmd)
* "dump" command
*/
static const vshCmdInfo info_dump[] = {
- {"syntax", "dump <domain> <file>"},
{"help", gettext_noop("dump the core of a domain to a file for analysis")},
{"desc", gettext_noop("Core dump a domain.")},
{NULL, NULL}
@@ -1369,7 +1352,6 @@ cmdDump(vshControl *ctl, const vshCmd *cmd)
* "resume" command
*/
static const vshCmdInfo info_resume[] = {
- {"syntax", "resume <domain>"},
{"help", gettext_noop("resume a domain")},
{"desc", gettext_noop("Resume a previously suspended domain.")},
{NULL, NULL}
@@ -1408,7 +1390,6 @@ cmdResume(vshControl *ctl, const vshCmd *cmd)
* "shutdown" command
*/
static const vshCmdInfo info_shutdown[] = {
- {"syntax", "shutdown <domain>"},
{"help", gettext_noop("gracefully shutdown a domain")},
{"desc", gettext_noop("Run shutdown in the target domain.")},
{NULL, NULL}
@@ -1447,7 +1428,6 @@ cmdShutdown(vshControl *ctl, const vshCmd *cmd)
* "reboot" command
*/
static const vshCmdInfo info_reboot[] = {
- {"syntax", "reboot <domain>"},
{"help", gettext_noop("reboot a domain")},
{"desc", gettext_noop("Run a reboot command in the target domain.")},
{NULL, NULL}
@@ -1486,7 +1466,6 @@ cmdReboot(vshControl *ctl, const vshCmd *cmd)
* "destroy" command
*/
static const vshCmdInfo info_destroy[] = {
- {"syntax", "destroy <domain>"},
{"help", gettext_noop("destroy a domain")},
{"desc", gettext_noop("Destroy a given domain.")},
{NULL, NULL}
@@ -1525,7 +1504,6 @@ cmdDestroy(vshControl *ctl, const vshCmd *cmd)
* "dominfo" command
*/
static const vshCmdInfo info_dominfo[] = {
- {"syntax", "dominfo <domain>"},
{"help", gettext_noop("domain information")},
{"desc", gettext_noop("Returns basic information about the domain.")},
{NULL, NULL}
@@ -1607,7 +1585,6 @@ cmdDominfo(vshControl *ctl, const vshCmd *cmd)
* "freecell" command
*/
static const vshCmdInfo info_freecell[] = {
- {"syntax", "freecell [<cellno>]"},
{"help", gettext_noop("NUMA free memory")},
{"desc", gettext_noop("display available free memory for the NUMA cell.")},
{NULL, NULL}
@@ -1649,7 +1626,6 @@ cmdFreecell(vshControl *ctl, const vshCmd *cmd)
* "vcpuinfo" command
*/
static const vshCmdInfo info_vcpuinfo[] = {
- {"syntax", "vcpuinfo <domain>"},
{"help", gettext_noop("domain vcpu information")},
{"desc", gettext_noop("Returns basic information about the domain virtual CPUs.")},
{NULL, NULL}
@@ -1736,7 +1712,6 @@ cmdVcpuinfo(vshControl *ctl, const vshCmd *cmd)
* "vcpupin" command
*/
static const vshCmdInfo info_vcpupin[] = {
- {"syntax", "vcpupin <domain> <vcpu> <cpulist>"},
{"help", gettext_noop("control domain vcpu affinity")},
{"desc", gettext_noop("Pin domain VCPUs to host physical CPUs.")},
{NULL, NULL}
@@ -1870,7 +1845,6 @@ cmdVcpupin(vshControl *ctl, const vshCmd *cmd)
* "setvcpus" command
*/
static const vshCmdInfo info_setvcpus[] = {
- {"syntax", "setvcpus <domain> <count>"},
{"help", gettext_noop("change number of virtual CPUs")},
{"desc", gettext_noop("Change the number of virtual CPUs in the guest domain.")},
{NULL, NULL}
@@ -1927,7 +1901,6 @@ cmdSetvcpus(vshControl *ctl, const vshCmd *cmd)
* "setmemory" command
*/
static const vshCmdInfo info_setmem[] = {
- {"syntax", "setmem <domain> <kilobytes>"},
{"help", gettext_noop("change memory allocation")},
{"desc", gettext_noop("Change the current memory allocation in the guest domain.")},
{NULL, NULL}
@@ -1984,7 +1957,6 @@ cmdSetmem(vshControl *ctl, const vshCmd *cmd)
* "setmaxmem" command
*/
static const vshCmdInfo info_setmaxmem[] = {
- {"syntax", "setmaxmem <domain> <kilobytes>"},
{"help", gettext_noop("change maximum memory limit")},
{"desc", gettext_noop("Change the maximum memory allocation limit in the guest domain.")},
{NULL, NULL}
@@ -2044,7 +2016,6 @@ cmdSetmaxmem(vshControl *ctl, const vshCmd *cmd)
* "nodeinfo" command
*/
static const vshCmdInfo info_nodeinfo[] = {
- {"syntax", "nodeinfo"},
{"help", gettext_noop("node information")},
{"desc", gettext_noop("Returns basic information about the node.")},
{NULL, NULL}
@@ -2078,7 +2049,6 @@ cmdNodeinfo(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED)
* "capabilities" command
*/
static const vshCmdInfo info_capabilities[] = {
- {"syntax", "capabilities"},
{"help", gettext_noop("capabilities")},
{"desc", gettext_noop("Returns capabilities of hypervisor/driver.")},
{NULL, NULL}
@@ -2106,7 +2076,6 @@ cmdCapabilities (vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED)
* "dumpxml" command
*/
static const vshCmdInfo info_dumpxml[] = {
- {"syntax", "dumpxml <domain>"},
{"help", gettext_noop("domain information in XML")},
{"desc", gettext_noop("Output the domain information as an XML dump to stdout.")},
{NULL, NULL}
@@ -2146,7 +2115,6 @@ cmdDumpXML(vshControl *ctl, const vshCmd *cmd)
* "domname" command
*/
static const vshCmdInfo info_domname[] = {
- {"syntax", "domname <domain>"},
{"help", gettext_noop("convert a domain id or UUID to domain name")},
{"desc", gettext_noop("")}, /* FIXME: describe */
{NULL, NULL}
@@ -2177,7 +2145,6 @@ cmdDomname(vshControl *ctl, const vshCmd *cmd)
* "domid" command
*/
static const vshCmdInfo info_domid[] = {
- {"syntax", "domid <domain>"},
{"help", gettext_noop("convert a domain name or UUID to domain id")},
{"desc", gettext_noop("")}, /* FIXME: describe */
{NULL, NULL}
@@ -2213,7 +2180,6 @@ cmdDomid(vshControl *ctl, const vshCmd *cmd)
* "domuuid" command
*/
static const vshCmdInfo info_domuuid[] = {
- {"syntax", "domuuid <domain>"},
{"help", gettext_noop("convert a domain name or id to domain UUID")},
{"desc", gettext_noop("")}, /* FIXME: describe */
{NULL, NULL}
@@ -2249,7 +2215,6 @@ cmdDomuuid(vshControl *ctl, const vshCmd *cmd)
* "migrate" command
*/
static const vshCmdInfo info_migrate[] = {
- {"syntax", "migrate [--live] <domain> <desturi> [<migrateuri>]"},
{"help", gettext_noop("migrate domain to another host")},
{"desc", gettext_noop("Migrate domain to another host. Add --live for live migration.")},
{NULL, NULL}
@@ -2317,7 +2282,6 @@ cmdMigrate (vshControl *ctl, const vshCmd *cmd)
* "net-autostart" command
*/
static const vshCmdInfo info_network_autostart[] = {
- {"syntax", "net-autostart [--disable] <network>"},
{"help", gettext_noop("autostart a network")},
{"desc",
gettext_noop("Configure a network to be automatically started at boot.")},
@@ -2368,7 +2332,6 @@ cmdNetworkAutostart(vshControl *ctl, const vshCmd *cmd)
* "net-create" command
*/
static const vshCmdInfo info_network_create[] = {
- {"syntax", "net-create <file>"},
{"help", gettext_noop("create a network from an XML file")},
{"desc", gettext_noop("Create a network.")},
{NULL, NULL}
@@ -2416,7 +2379,6 @@ cmdNetworkCreate(vshControl *ctl, const vshCmd *cmd)
* "net-define" command
*/
static const vshCmdInfo info_network_define[] = {
- {"syntax", "net-define <file>"},
{"help", gettext_noop("define (but don't start) a network from an XML file")},
{"desc", gettext_noop("Define a network.")},
{NULL, NULL}
@@ -2464,7 +2426,6 @@ cmdNetworkDefine(vshControl *ctl, const vshCmd *cmd)
* "net-destroy" command
*/
static const vshCmdInfo info_network_destroy[] = {
- {"syntax", "net-destroy <network>"},
{"help", gettext_noop("destroy a network")},
{"desc", gettext_noop("Destroy a given network.")},
{NULL, NULL}
@@ -2504,7 +2465,6 @@ cmdNetworkDestroy(vshControl *ctl, const vshCmd *cmd)
* "net-dumpxml" command
*/
static const vshCmdInfo info_network_dumpxml[] = {
- {"syntax", "net-dumpxml <network>"},
{"help", gettext_noop("network information in XML")},
{"desc", gettext_noop("Output the network information as an XML dump to stdout.")},
{NULL, NULL}
@@ -2545,7 +2505,6 @@ cmdNetworkDumpXML(vshControl *ctl, const vshCmd *cmd)
* "net-list" command
*/
static const vshCmdInfo info_network_list[] = {
- {"syntax", "net-list [ --inactive | --all ]"},
{"help", gettext_noop("list networks")},
{"desc", gettext_noop("Returns list of networks.")},
{NULL, NULL}
@@ -2669,7 +2628,6 @@ cmdNetworkList(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED)
* "net-name" command
*/
static const vshCmdInfo info_network_name[] = {
- {"syntax", "net-name <network>"},
{"help", gettext_noop("convert a network UUID to network name")},
{"desc", gettext_noop("")}, /* FIXME: describe */
{NULL, NULL}
@@ -2701,7 +2659,6 @@ cmdNetworkName(vshControl *ctl, const vshCmd *cmd)
* "net-start" command
*/
static const vshCmdInfo info_network_start[] = {
- {"syntax", "net-start <network>"},
{"help", gettext_noop("start a (previously defined) inactive network")},
{"desc", gettext_noop("Start a network.")},
{NULL, NULL}
@@ -2740,7 +2697,6 @@ cmdNetworkStart(vshControl *ctl, const vshCmd *cmd)
* "net-undefine" command
*/
static const vshCmdInfo info_network_undefine[] = {
- {"syntax", "net-undefine <network>"},
{"help", gettext_noop("undefine an inactive network")},
{"desc", gettext_noop("Undefine the configuration for an inactive network.")},
{NULL, NULL}
@@ -2779,7 +2735,6 @@ cmdNetworkUndefine(vshControl *ctl, const vshCmd *cmd)
* "net-uuid" command
*/
static const vshCmdInfo info_network_uuid[] = {
- {"syntax", "net-uuid <network>"},
{"help", gettext_noop("convert a network name to network UUID")},
{"desc", gettext_noop("")}, /* FIXME: describe */
{NULL, NULL}
@@ -2816,7 +2771,6 @@ cmdNetworkUuid(vshControl *ctl, const vshCmd *cmd)
* "pool-autostart" command
*/
static const vshCmdInfo info_pool_autostart[] = {
- {"syntax", "pool-autostart [--disable] <pool>"},
{"help", gettext_noop("autostart a pool")},
{"desc",
gettext_noop("Configure a pool to be automatically started at boot.")},
@@ -2867,7 +2821,6 @@ cmdPoolAutostart(vshControl *ctl, const vshCmd *cmd)
* "pool-create" command
*/
static const vshCmdInfo info_pool_create[] = {
- {"syntax", "pool-create <file>"},
{"help", gettext_noop("create a pool from an XML file")},
{"desc", gettext_noop("Create a pool.")},
{NULL, NULL}
@@ -2915,7 +2868,6 @@ cmdPoolCreate(vshControl *ctl, const vshCmd *cmd)
* "pool-create-as" command
*/
static const vshCmdInfo info_pool_create_as[] = {
- {"syntax", "pool-create-as <name> <type>"},
{"help", gettext_noop("create a pool from a set of args")},
{"desc", gettext_noop("Create a pool.")},
{NULL, NULL}
@@ -3006,7 +2958,6 @@ cmdPoolCreateAs(vshControl *ctl, const vshCmd *cmd)
* "pool-define" command
*/
static const vshCmdInfo info_pool_define[] = {
- {"syntax", "pool-define <file>"},
{"help", gettext_noop("define (but don't start) a pool from an XML file")},
{"desc", gettext_noop("Define a pool.")},
{NULL, NULL}
@@ -3054,7 +3005,6 @@ cmdPoolDefine(vshControl *ctl, const vshCmd *cmd)
* "pool-define-as" command
*/
static const vshCmdInfo info_pool_define_as[] = {
- {"syntax", "pool-define-as <name> <type>"},
{"help", gettext_noop("define a pool from a set of args")},
{"desc", gettext_noop("Define a pool.")},
{NULL, NULL}
@@ -3148,7 +3098,6 @@ cmdPoolDefineAs(vshControl *ctl, const vshCmd *cmd)
* "pool-build" command
*/
static const vshCmdInfo info_pool_build[] = {
- {"syntax", "pool-build <pool>"},
{"help", gettext_noop("build a pool")},
{"desc", gettext_noop("Build a given pool.")},
{NULL, NULL}
@@ -3188,7 +3137,6 @@ cmdPoolBuild(vshControl *ctl, const vshCmd *cmd)
* "pool-destroy" command
*/
static const vshCmdInfo info_pool_destroy[] = {
- {"syntax", "pool-destroy <pool>"},
{"help", gettext_noop("destroy a pool")},
{"desc", gettext_noop("Destroy a given pool.")},
{NULL, NULL}
@@ -3228,7 +3176,6 @@ cmdPoolDestroy(vshControl *ctl, const vshCmd *cmd)
* "pool-delete" command
*/
static const vshCmdInfo info_pool_delete[] = {
- {"syntax", "pool-delete <pool>"},
{"help", gettext_noop("delete a pool")},
{"desc", gettext_noop("Delete a given pool.")},
{NULL, NULL}
@@ -3268,7 +3215,6 @@ cmdPoolDelete(vshControl *ctl, const vshCmd *cmd)
* "pool-refresh" command
*/
static const vshCmdInfo info_pool_refresh[] = {
- {"syntax", "pool-refresh <pool>"},
{"help", gettext_noop("refresh a pool")},
{"desc", gettext_noop("Refresh a given pool.")},
{NULL, NULL}
@@ -3308,7 +3254,6 @@ cmdPoolRefresh(vshControl *ctl, const vshCmd *cmd)
* "pool-dumpxml" command
*/
static const vshCmdInfo info_pool_dumpxml[] = {
- {"syntax", "pool-dumpxml <pool>"},
{"help", gettext_noop("pool information in XML")},
{"desc", gettext_noop("Output the pool information as an XML dump to stdout.")},
{NULL, NULL}
@@ -3349,7 +3294,6 @@ cmdPoolDumpXML(vshControl *ctl, const vshCmd *cmd)
* "pool-list" command
*/
static const vshCmdInfo info_pool_list[] = {
- {"syntax", "pool-list [ --inactive | --all ]"},
{"help", gettext_noop("list pools")},
{"desc", gettext_noop("Returns list of pools.")},
{NULL, NULL}
@@ -3472,7 +3416,6 @@ cmdPoolList(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED)
* "find-storage-pool-sources-as" command
*/
static const vshCmdInfo info_find_storage_pool_sources_as[] = {
- {"syntax", "find-storage-pool-sources-as <type> [options]"},
{"help", gettext_noop("find potential storage pool sources")},
{"desc", gettext_noop("Returns XML <sources> document.")},
{NULL, NULL}
@@ -3553,7 +3496,6 @@ cmdPoolDiscoverSourcesAs(vshControl * ctl, const vshCmd * cmd ATTRIBUTE_UNUSED)
* "find-storage-pool-sources" command
*/
static const vshCmdInfo info_find_storage_pool_sources[] = {
- {"syntax", "find-storage-pool-sources <type> [srcSpec]"},
{"help", gettext_noop("discover potential storage pool sources")},
{"desc", gettext_noop("Returns XML <sources> document.")},
{NULL, NULL}
@@ -3626,7 +3568,6 @@ prettyCapacity(unsigned long long val,
* "pool-info" command
*/
static const vshCmdInfo info_pool_info[] = {
- {"syntax", "pool-info <pool>"},
{"help", gettext_noop("storage pool information")},
{"desc", gettext_noop("Returns basic information about the storage pool.")},
{NULL, NULL}
@@ -3702,7 +3643,6 @@ cmdPoolInfo(vshControl *ctl, const vshCmd *cmd)
* "pool-name" command
*/
static const vshCmdInfo info_pool_name[] = {
- {"syntax", "pool-name <pool>"},
{"help", gettext_noop("convert a pool UUID to pool name")},
{"desc", gettext_noop("")}, /* FIXME: describe */
{NULL, NULL}
@@ -3734,7 +3674,6 @@ cmdPoolName(vshControl *ctl, const vshCmd *cmd)
* "pool-start" command
*/
static const vshCmdInfo info_pool_start[] = {
- {"syntax", "pool-start <pool>"},
{"help", gettext_noop("start a (previously defined) inactive pool")},
{"desc", gettext_noop("Start a pool.")},
{NULL, NULL}
@@ -3773,7 +3712,6 @@ cmdPoolStart(vshControl *ctl, const vshCmd *cmd)
* "vol-create-as" command
*/
static const vshCmdInfo info_vol_create_as[] = {
- {"syntax", "vol-create-as <pool> <name> <capacity>"},
{"help", gettext_noop("create a volume from a set of args")},
{"desc", gettext_noop("Create a vol.")},
{NULL, NULL}
@@ -3895,7 +3833,6 @@ cmdVolCreateAs(vshControl *ctl, const vshCmd *cmd)
* "pool-undefine" command
*/
static const vshCmdInfo info_pool_undefine[] = {
- {"syntax", "pool-undefine <pool>"},
{"help", gettext_noop("undefine an inactive pool")},
{"desc", gettext_noop("Undefine the configuration for an inactive pool.")},
{NULL, NULL}
@@ -3934,7 +3871,6 @@ cmdPoolUndefine(vshControl *ctl, const vshCmd *cmd)
* "pool-uuid" command
*/
static const vshCmdInfo info_pool_uuid[] = {
- {"syntax", "pool-uuid <pool>"},
{"help", gettext_noop("convert a pool name to pool UUID")},
{"desc", gettext_noop("")}, /* FIXME: describe */
{NULL, NULL}
@@ -3973,7 +3909,6 @@ cmdPoolUuid(vshControl *ctl, const vshCmd *cmd)
* "vol-create" command
*/
static const vshCmdInfo info_vol_create[] = {
- {"syntax", "vol-create <file>"},
{"help", gettext_noop("create a vol from an XML file")},
{"desc", gettext_noop("Create a vol.")},
{NULL, NULL}
@@ -4032,7 +3967,6 @@ cmdVolCreate(vshControl *ctl, const vshCmd *cmd)
* "vol-delete" command
*/
static const vshCmdInfo info_vol_delete[] = {
- {"syntax", "vol-delete <vol>"},
{"help", gettext_noop("delete a vol")},
{"desc", gettext_noop("Delete a given vol.")},
{NULL, NULL}
@@ -4074,7 +4008,6 @@ cmdVolDelete(vshControl *ctl, const vshCmd *cmd)
* "vol-info" command
*/
static const vshCmdInfo info_vol_info[] = {
- {"syntax", "vol-info <vol>"},
{"help", gettext_noop("storage vol information")},
{"desc", gettext_noop("Returns basic information about the storage vol.")},
{NULL, NULL}
@@ -4126,7 +4059,6 @@ cmdVolInfo(vshControl *ctl, const vshCmd *cmd)
* "vol-dumpxml" command
*/
static const vshCmdInfo info_vol_dumpxml[] = {
- {"syntax", "vol-dumpxml <vol>"},
{"help", gettext_noop("vol information in XML")},
{"desc", gettext_noop("Output the vol information as an XML dump to stdout.")},
{NULL, NULL}
@@ -4168,7 +4100,6 @@ cmdVolDumpXML(vshControl *ctl, const vshCmd *cmd)
* "vol-list" command
*/
static const vshCmdInfo info_vol_list[] = {
- {"syntax", "vol-list <pool>"},
{"help", gettext_noop("list vols")},
{"desc", gettext_noop("Returns list of vols by pool.")},
{NULL, NULL}
@@ -4247,7 +4178,6 @@ cmdVolList(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED)
* "vol-name" command
*/
static const vshCmdInfo info_vol_name[] = {
- {"syntax", "vol-name <vol>"},
{"help", gettext_noop("convert a vol UUID to vol name")},
{"desc", gettext_noop("")}, /* FIXME: describe */
{NULL, NULL}
@@ -4281,7 +4211,6 @@ cmdVolName(vshControl *ctl, const vshCmd *cmd)
* "vol-key" command
*/
static const vshCmdInfo info_vol_key[] = {
- {"syntax", "vol-key <vol>"},
{"help", gettext_noop("convert a vol UUID to vol key")},
{"desc", gettext_noop("")}, /* FIXME: describe */
{NULL, NULL}
@@ -4315,7 +4244,6 @@ cmdVolKey(vshControl *ctl, const vshCmd *cmd)
* "vol-path" command
*/
static const vshCmdInfo info_vol_path[] = {
- {"syntax", "vol-path <pool> <vol>"},
{"help", gettext_noop("convert a vol UUID to vol path")},
{"desc", gettext_noop("")}, /* FIXME: describe */
{NULL, NULL}
@@ -4353,7 +4281,6 @@ cmdVolPath(vshControl *ctl, const vshCmd *cmd)
* "version" command
*/
static const vshCmdInfo info_version[] = {
- {"syntax", "version"},
{"help", gettext_noop("show version")},
{"desc", gettext_noop("Display the system version information.")},
{NULL, NULL}
@@ -4433,7 +4360,6 @@ cmdVersion(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED)
* "nodedev-list" command
*/
static const vshCmdInfo info_node_list_devices[] = {
- {"syntax", "nodedev-list [--cap <capability>]"},
{"help", gettext_noop("enumerate devices on this host")},
{"desc", gettext_noop("")}, /* FIXME: describe */
{NULL, NULL}
@@ -4487,7 +4413,6 @@ cmdNodeListDevices (vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED)
* "nodedev-dumpxml" command
*/
static const vshCmdInfo info_node_device_dumpxml[] = {
- {"syntax", "nodedev-dumpxml <device>"},
{"help", gettext_noop("node device details in XML")},
{"desc", gettext_noop("Output the node device details as an XML dump to stdout.")},
{NULL, NULL}
@@ -4523,7 +4448,6 @@ cmdNodeDeviceDumpXML (vshControl *ctl, const vshCmd *cmd)
* "hostkey" command
*/
static const vshCmdInfo info_hostname[] = {
- {"syntax", "hostname"},
{"help", gettext_noop("print the hypervisor hostname")},
{"desc", gettext_noop("")}, /* FIXME: describe */
{NULL, NULL}
@@ -4553,7 +4477,6 @@ cmdHostname (vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED)
* "uri" command
*/
static const vshCmdInfo info_uri[] = {
- {"syntax", "uri"},
{"help", gettext_noop("print the hypervisor canonical URI")},
{"desc", gettext_noop("")}, /* FIXME: describe */
{NULL, NULL}
@@ -4583,7 +4506,6 @@ cmdURI (vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED)
* "vncdisplay" command
*/
static const vshCmdInfo info_vncdisplay[] = {
- {"syntax", "vncdisplay <domain>"},
{"help", gettext_noop("vnc display")},
{"desc", gettext_noop("Output the IP address and port number for the VNC display.")},
{NULL, NULL}
@@ -4659,7 +4581,6 @@ cmdVNCDisplay(vshControl *ctl, const vshCmd *cmd)
* "ttyconsole" command
*/
static const vshCmdInfo info_ttyconsole[] = {
- {"syntax", "ttyconsole <domain>"},
{"help", gettext_noop("tty console")},
{"desc", gettext_noop("Output the device for the TTY console.")},
{NULL, NULL}
@@ -4720,7 +4641,6 @@ cmdTTYConsole(vshControl *ctl, const vshCmd *cmd)
* "attach-device" command
*/
static const vshCmdInfo info_attach_device[] = {
- {"syntax", "attach-device <domain> <file> "},
{"help", gettext_noop("attach device from an XML file")},
{"desc", gettext_noop("Attach device from an XML <file>.")},
{NULL, NULL}
@@ -4779,7 +4699,6 @@ cmdAttachDevice(vshControl *ctl, const vshCmd *cmd)
* "detach-device" command
*/
static const vshCmdInfo info_detach_device[] = {
- {"syntax", "detach-device <domain> <file> "},
{"help", gettext_noop("detach device from an XML file")},
{"desc", gettext_noop("Detach device from an XML <file>")},
{NULL, NULL}
@@ -4838,7 +4757,6 @@ cmdDetachDevice(vshControl *ctl, const vshCmd *cmd)
* "attach-interface" command
*/
static const vshCmdInfo info_attach_interface[] = {
- {"syntax", "attach-interface <domain> <type> <source> [--target <target>] [--mac <mac>] [--script <script>] "},
{"help", gettext_noop("attach network interface")},
{"desc", gettext_noop("Attach new network interface.")},
{NULL, NULL}
@@ -4955,7 +4873,6 @@ cmdAttachInterface(vshControl *ctl, const vshCmd *cmd)
* "detach-interface" command
*/
static const vshCmdInfo info_detach_interface[] = {
- {"syntax", "detach-interface <domain> <type> [--mac <mac>] "},
{"help", gettext_noop("detach network interface")},
{"desc", gettext_noop("Detach network interface.")},
{NULL, NULL}
@@ -5076,7 +4993,6 @@ cmdDetachInterface(vshControl *ctl, const vshCmd *cmd)
* "attach-disk" command
*/
static const vshCmdInfo info_attach_disk[] = {
- {"syntax", "attach-disk <domain> <source> <target> [--driver <driver>] [--subdriver <subdriver>] [--type <type>] [--mode <mode>] "},
{"help", gettext_noop("attach disk device")},
{"desc", gettext_noop("Attach new disk device.")},
{NULL, NULL}
@@ -5241,7 +5157,6 @@ cmdAttachDisk(vshControl *ctl, const vshCmd *cmd)
* "detach-disk" command
*/
static const vshCmdInfo info_detach_disk[] = {
- {"syntax", "detach-disk <domain> <target> "},
{"help", gettext_noop("detach disk device")},
{"desc", gettext_noop("Detach disk device.")},
{NULL, NULL}
@@ -5472,7 +5387,6 @@ editReadBackFile (vshControl *ctl, const char *filename)
* "edit" command
*/
static const vshCmdInfo info_edit[] = {
- {"syntax", "edit <domain>"},
{"help", gettext_noop("edit XML configuration for a domain")},
{"desc", gettext_noop("Edit the XML configuration for a domain.")},
{NULL, NULL}
@@ -5575,7 +5489,6 @@ cmdEdit (vshControl *ctl, const vshCmd *cmd)
* "net-edit" command
*/
static const vshCmdInfo info_network_edit[] = {
- {"syntax", "net-edit <network>"},
{"help", gettext_noop("edit XML configuration for a network")},
{"desc", gettext_noop("Edit the XML configuration for a network.")},
{NULL, NULL}
@@ -5593,7 +5506,6 @@ static const vshCmdOptDef opts_network_edit[] = {
* "pool-edit" command
*/
static const vshCmdInfo info_pool_edit[] = {
- {"syntax", "pool-edit <domain>"},
{"help", gettext_noop("edit XML configuration for a storage pool")},
{"desc", gettext_noop("Edit the XML configuration for a storage pool.")},
{NULL, NULL}
@@ -5611,7 +5523,6 @@ static const vshCmdOptDef opts_pool_edit[] = {
* "quit" command
*/
static const vshCmdInfo info_quit[] = {
- {"syntax", "quit"},
{"help", gettext_noop("quit this interactive terminal")},
{"desc", gettext_noop("")}, /* FIXME: describe */
{NULL, NULL}
--
1.6.0.4.1101.g642f8
15 years, 10 months
[libvirt] [PATCH 4/4] virsh.c: tweak options to produce more accurate help
by Jim Meyering
* src/virsh.c: Adjust some vshCmdOptDef command option flags
to improve auto-generated help command syntax.
---
src/virsh.c | 18 +++++++++---------
1 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/src/virsh.c b/src/virsh.c
index 230a128..bb81f25 100644
--- a/src/virsh.c
+++ b/src/virsh.c
@@ -1008,7 +1008,7 @@ static const vshCmdInfo info_start[] = {
};
static const vshCmdOptDef opts_start[] = {
- {"name", VSH_OT_DATA, VSH_OFLAG_REQ, gettext_noop("name of the inactive domain")},
+ {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, gettext_noop("name of the inactive domain")},
{NULL, 0, 0, NULL}
};
@@ -3680,7 +3680,7 @@ static const vshCmdInfo info_pool_start[] = {
};
static const vshCmdOptDef opts_pool_start[] = {
- {"name", VSH_OT_DATA, VSH_OFLAG_REQ, gettext_noop("name of the inactive pool")},
+ {"pool", VSH_OT_DATA, VSH_OFLAG_REQ, gettext_noop("name of the inactive pool")},
{NULL, 0, 0, NULL}
};
@@ -3721,8 +3721,8 @@ static const vshCmdOptDef opts_vol_create_as[] = {
{"pool", VSH_OT_DATA, VSH_OFLAG_REQ, gettext_noop("pool name")},
{"name", VSH_OT_DATA, VSH_OFLAG_REQ, gettext_noop("name of the volume")},
{"capacity", VSH_OT_DATA, VSH_OFLAG_REQ, gettext_noop("size of the vol with optional k,M,G,T suffix")},
- {"allocation", VSH_OT_DATA, 0, gettext_noop("initial allocation size with optional k,M,G,T suffix")},
- {"format", VSH_OT_DATA, 0, gettext_noop("file format type raw,bochs,qcow,qcow2,vmdk")},
+ {"allocation", VSH_OT_STRING, 0, gettext_noop("initial allocation size with optional k,M,G,T suffix")},
+ {"format", VSH_OT_STRING, 0, gettext_noop("file format type raw,bochs,qcow,qcow2,vmdk")},
{NULL, 0, 0, NULL}
};
@@ -4881,7 +4881,7 @@ static const vshCmdInfo info_detach_interface[] = {
static const vshCmdOptDef opts_detach_interface[] = {
{"domain", VSH_OT_DATA, VSH_OFLAG_REQ, gettext_noop("domain name, id or uuid")},
{"type", VSH_OT_DATA, VSH_OFLAG_REQ, gettext_noop("network interface type")},
- {"mac", VSH_OT_DATA, 0, gettext_noop("MAC address")},
+ {"mac", VSH_OT_STRING, 0, gettext_noop("MAC address")},
{NULL, 0, 0, NULL}
};
@@ -5002,10 +5002,10 @@ static const vshCmdOptDef opts_attach_disk[] = {
{"domain", VSH_OT_DATA, VSH_OFLAG_REQ, gettext_noop("domain name, id or uuid")},
{"source", VSH_OT_DATA, VSH_OFLAG_REQ, gettext_noop("source of disk device")},
{"target", VSH_OT_DATA, VSH_OFLAG_REQ, gettext_noop("target of disk device")},
- {"driver", VSH_OT_DATA, 0, gettext_noop("driver of disk device")},
- {"subdriver", VSH_OT_DATA, 0, gettext_noop("subdriver of disk device")},
- {"type", VSH_OT_DATA, 0, gettext_noop("target device type")},
- {"mode", VSH_OT_DATA, 0, gettext_noop("mode of device reading and writing")},
+ {"driver", VSH_OT_STRING, 0, gettext_noop("driver of disk device")},
+ {"subdriver", VSH_OT_STRING, 0, gettext_noop("subdriver of disk device")},
+ {"type", VSH_OT_STRING, 0, gettext_noop("target device type")},
+ {"mode", VSH_OT_STRING, 0, gettext_noop("mode of device reading and writing")},
{NULL, 0, 0, NULL}
};
--
1.6.0.4.1101.g642f8
15 years, 10 months
[libvirt] [PATCH 2/4] virsh.c: add missing (yet empty) "desc" strings
by Jim Meyering
* src/virsh.c: Now, every command must have a "desc" string,
even if it has zero length. Mark these, so they'll be filled in.
---
src/virsh.c | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/src/virsh.c b/src/virsh.c
index 96a7132..d96a7d4 100644
--- a/src/virsh.c
+++ b/src/virsh.c
@@ -2148,6 +2148,7 @@ cmdDumpXML(vshControl *ctl, const vshCmd *cmd)
static const vshCmdInfo info_domname[] = {
{"syntax", "domname <domain>"},
{"help", gettext_noop("convert a domain id or UUID to domain name")},
+ {"desc", gettext_noop("")}, /* FIXME: describe */
{NULL, NULL}
};
@@ -2178,6 +2179,7 @@ cmdDomname(vshControl *ctl, const vshCmd *cmd)
static const vshCmdInfo info_domid[] = {
{"syntax", "domid <domain>"},
{"help", gettext_noop("convert a domain name or UUID to domain id")},
+ {"desc", gettext_noop("")}, /* FIXME: describe */
{NULL, NULL}
};
@@ -2213,6 +2215,7 @@ cmdDomid(vshControl *ctl, const vshCmd *cmd)
static const vshCmdInfo info_domuuid[] = {
{"syntax", "domuuid <domain>"},
{"help", gettext_noop("convert a domain name or id to domain UUID")},
+ {"desc", gettext_noop("")}, /* FIXME: describe */
{NULL, NULL}
};
@@ -2668,6 +2671,7 @@ cmdNetworkList(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED)
static const vshCmdInfo info_network_name[] = {
{"syntax", "net-name <network>"},
{"help", gettext_noop("convert a network UUID to network name")},
+ {"desc", gettext_noop("")}, /* FIXME: describe */
{NULL, NULL}
};
@@ -2777,6 +2781,7 @@ cmdNetworkUndefine(vshControl *ctl, const vshCmd *cmd)
static const vshCmdInfo info_network_uuid[] = {
{"syntax", "net-uuid <network>"},
{"help", gettext_noop("convert a network name to network UUID")},
+ {"desc", gettext_noop("")}, /* FIXME: describe */
{NULL, NULL}
};
@@ -3699,6 +3704,7 @@ cmdPoolInfo(vshControl *ctl, const vshCmd *cmd)
static const vshCmdInfo info_pool_name[] = {
{"syntax", "pool-name <pool>"},
{"help", gettext_noop("convert a pool UUID to pool name")},
+ {"desc", gettext_noop("")}, /* FIXME: describe */
{NULL, NULL}
};
@@ -3930,6 +3936,7 @@ cmdPoolUndefine(vshControl *ctl, const vshCmd *cmd)
static const vshCmdInfo info_pool_uuid[] = {
{"syntax", "pool-uuid <pool>"},
{"help", gettext_noop("convert a pool name to pool UUID")},
+ {"desc", gettext_noop("")}, /* FIXME: describe */
{NULL, NULL}
};
@@ -4242,6 +4249,7 @@ cmdVolList(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED)
static const vshCmdInfo info_vol_name[] = {
{"syntax", "vol-name <vol>"},
{"help", gettext_noop("convert a vol UUID to vol name")},
+ {"desc", gettext_noop("")}, /* FIXME: describe */
{NULL, NULL}
};
@@ -4275,6 +4283,7 @@ cmdVolName(vshControl *ctl, const vshCmd *cmd)
static const vshCmdInfo info_vol_key[] = {
{"syntax", "vol-key <vol>"},
{"help", gettext_noop("convert a vol UUID to vol key")},
+ {"desc", gettext_noop("")}, /* FIXME: describe */
{NULL, NULL}
};
@@ -4308,6 +4317,7 @@ cmdVolKey(vshControl *ctl, const vshCmd *cmd)
static const vshCmdInfo info_vol_path[] = {
{"syntax", "vol-path <pool> <vol>"},
{"help", gettext_noop("convert a vol UUID to vol path")},
+ {"desc", gettext_noop("")}, /* FIXME: describe */
{NULL, NULL}
};
@@ -4425,6 +4435,7 @@ cmdVersion(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED)
static const vshCmdInfo info_node_list_devices[] = {
{"syntax", "nodedev-list [--cap <capability>]"},
{"help", gettext_noop("enumerate devices on this host")},
+ {"desc", gettext_noop("")}, /* FIXME: describe */
{NULL, NULL}
};
@@ -4514,6 +4525,7 @@ cmdNodeDeviceDumpXML (vshControl *ctl, const vshCmd *cmd)
static const vshCmdInfo info_hostname[] = {
{"syntax", "hostname"},
{"help", gettext_noop("print the hypervisor hostname")},
+ {"desc", gettext_noop("")}, /* FIXME: describe */
{NULL, NULL}
};
@@ -4543,6 +4555,7 @@ cmdHostname (vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED)
static const vshCmdInfo info_uri[] = {
{"syntax", "uri"},
{"help", gettext_noop("print the hypervisor canonical URI")},
+ {"desc", gettext_noop("")}, /* FIXME: describe */
{NULL, NULL}
};
@@ -5600,6 +5613,7 @@ static const vshCmdOptDef opts_pool_edit[] = {
static const vshCmdInfo info_quit[] = {
{"syntax", "quit"},
{"help", gettext_noop("quit this interactive terminal")},
+ {"desc", gettext_noop("")}, /* FIXME: describe */
{NULL, NULL}
};
--
1.6.0.4.1101.g642f8
15 years, 10 months
[libvirt] [PATCH 1/4] virsh.c: generate each "virsh help COMMAND"s synopsis
by Jim Meyering
* src/virsh.c: Also, diagnose extra arguments after --help (-h).
---
src/virsh.c | 102 +++++++++++++++++++++++++++++++++-------------------------
1 files changed, 58 insertions(+), 44 deletions(-)
diff --git a/src/virsh.c b/src/virsh.c
index df12b8b..96a7132 100644
--- a/src/virsh.c
+++ b/src/virsh.c
@@ -224,7 +224,7 @@ static void vshError(vshControl *ctl, int doexit, const char *format, ...)
ATTRIBUTE_FORMAT(printf, 3, 4);
static int vshInit(vshControl *ctl);
static int vshDeinit(vshControl *ctl);
-static void vshUsage(vshControl *ctl, const char *cmdname);
+static void vshUsage(void);
static void vshOpenLogFile(vshControl *ctl);
static void vshOutputLogFile(vshControl *ctl, int log_level, const char *format, va_list ap);
static void vshCloseLogFile(vshControl *ctl);
@@ -233,7 +233,7 @@ static int vshParseArgv(vshControl *ctl, int argc, char **argv);
static const char *vshCmddefGetInfo(const vshCmdDef *cmd, const char *info);
static const vshCmdDef *vshCmddefSearch(const char *cmdname);
-static int vshCmddefHelp(vshControl *ctl, const char *name, int withprog);
+static int vshCmddefHelp(vshControl *ctl, const char *name);
static vshCmdOpt *vshCommandOpt(const vshCmd *cmd, const char *name);
static int vshCommandOptInt(const vshCmd *cmd, const char *name, int *found);
@@ -361,7 +361,7 @@ cmdHelp(vshControl *ctl, const vshCmd *cmd)
N_(vshCmddefGetInfo(def, "help")));
return TRUE;
}
- return vshCmddefHelp(ctl, cmdname, FALSE);
+ return vshCmddefHelp(ctl, cmdname);
}
/*
@@ -5803,7 +5803,7 @@ vshCmddefSearch(const char *cmdname)
}
static int
-vshCmddefHelp(vshControl *ctl, const char *cmdname, int withprog)
+vshCmddefHelp(vshControl *ctl, const char *cmdname)
{
const vshCmdDef *def = vshCmddefSearch(cmdname);
@@ -5811,30 +5811,46 @@ vshCmddefHelp(vshControl *ctl, const char *cmdname, int withprog)
vshError(ctl, FALSE, _("command '%s' doesn't exist"), cmdname);
return FALSE;
} else {
- const vshCmdOptDef *opt;
const char *desc = N_(vshCmddefGetInfo(def, "desc"));
const char *help = N_(vshCmddefGetInfo(def, "help"));
- const char *syntax = vshCmddefGetInfo(def, "syntax");
+ char buf[256];
fputs(_(" NAME\n"), stdout);
fprintf(stdout, " %s - %s\n", def->name, help);
- if (syntax) {
- fputs(_("\n SYNOPSIS\n"), stdout);
- if (!withprog)
- fprintf(stdout, " %s\n", syntax);
- else
- fprintf(stdout, " %s %s\n", progname, syntax);
+ fputs(_("\n SYNOPSIS\n"), stdout);
+ fprintf(stdout, " %s", def->name);
+ if (def->opts) {
+ const vshCmdOptDef *opt;
+ for (opt = def->opts; opt->name; opt++) {
+ const char *fmt;
+ if (opt->type == VSH_OT_BOOL)
+ fmt = "[--%s]";
+ else if (opt->type == VSH_OT_INT)
+ fmt = N_("[--%s <number>]");
+ else if (opt->type == VSH_OT_STRING)
+ fmt = N_("[--%s <string>]");
+ else if (opt->type == VSH_OT_DATA)
+ fmt = ((opt->flag & VSH_OFLAG_REQ) ? "<%s>" : "[<%s>]");
+ else
+ assert(0);
+ fputc(' ', stdout);
+ fprintf(stdout, _(fmt), opt->name);
+ }
}
- if (desc) {
+ fputc('\n', stdout);
+
+ if (desc[0]) {
+ /* FIXME: remove this test once all of the empty descriptions
+ have been removed; see `FIXME: describe' lines. */
fputs(_("\n DESCRIPTION\n"), stdout);
fprintf(stdout, " %s\n", desc);
}
+
if (def->opts) {
+ const vshCmdOptDef *opt;
fputs(_("\n OPTIONS\n"), stdout);
for (opt = def->opts; opt->name; opt++) {
- char buf[256];
-
if (opt->type == VSH_OT_BOOL)
snprintf(buf, sizeof(buf), "--%s", opt->name);
else if (opt->type == VSH_OT_INT)
@@ -6912,35 +6928,29 @@ vshDeinit(vshControl *ctl)
* Print usage
*/
static void
-vshUsage(vshControl *ctl, const char *cmdname)
+vshUsage(void)
{
const vshCmdDef *cmd;
-
- /* global help */
- if (!cmdname) {
- fprintf(stdout, _("\n%s [options] [commands]\n\n"
- " options:\n"
- " -c | --connect <uri> hypervisor connection URI\n"
- " -r | --readonly connect readonly\n"
- " -d | --debug <num> debug level [0-5]\n"
- " -h | --help this help\n"
- " -q | --quiet quiet mode\n"
- " -t | --timing print timing information\n"
- " -l | --log <file> output logging to file\n"
- " -v | --version program version\n\n"
- " commands (non interactive mode):\n"), progname);
-
- for (cmd = commands; cmd->name; cmd++)
- fprintf(stdout,
- " %-15s %s\n", cmd->name, N_(vshCmddefGetInfo(cmd,
- "help")));
-
- fprintf(stdout, "%s",
- _("\n (specify help <command> for details about the command)\n\n"));
- return;
- }
- if (!vshCmddefHelp(ctl, cmdname, TRUE))
- exit(EXIT_FAILURE);
+ fprintf(stdout, _("\n%s [options] [commands]\n\n"
+ " options:\n"
+ " -c | --connect <uri> hypervisor connection URI\n"
+ " -r | --readonly connect readonly\n"
+ " -d | --debug <num> debug level [0-5]\n"
+ " -h | --help this help\n"
+ " -q | --quiet quiet mode\n"
+ " -t | --timing print timing information\n"
+ " -l | --log <file> output logging to file\n"
+ " -v | --version program version\n\n"
+ " commands (non interactive mode):\n"), progname);
+
+ for (cmd = commands; cmd->name; cmd++)
+ fprintf(stdout,
+ " %-15s %s\n", cmd->name, N_(vshCmddefGetInfo(cmd,
+ "help")));
+
+ fprintf(stdout, "%s",
+ _("\n (specify help <command> for details about the command)\n\n"));
+ return;
}
/*
@@ -7038,8 +7048,12 @@ vshParseArgv(vshControl *ctl, int argc, char **argv)
}
if (help) {
- /* global or command specific help */
- vshUsage(ctl, argc > end ? argv[end] : NULL);
+ if (end < argc)
+ vshError(ctl, TRUE,
+ _("extra argument '%s'. See --help."), argv[end]);
+
+ /* list all command */
+ vshUsage();
exit(EXIT_SUCCESS);
}
--
1.6.0.4.1101.g642f8
15 years, 10 months
[libvirt] broken pipe?
by Itamar Heim
Hi,
I have a problem with a small python script (using fedora 10 with its
shipped rpm's - libvirt-0.4.6-3.fc10.x86_64,
libvirt-python-0.4.6-3.fc10.x86_64)
I'm running a simple stupid libvirt python script.
I happen to want to use SDL, and it fails on "Could not initialize SDL -
exiting".
While I need to solve this error (i.e., find out in which version this
patch was included to allow me to specify the DISPLAY
http://www.mail-archive.com/libvir-list@redhat.com/msg08764.html)
I am more troubled by the fact that running the script again gives a
socket/pipe error until I restart libvirtd:
Run #1:
./test_libvirt.py
libvir: QEMU error : internal error QEMU quit during console startup
Could not initialize SDL - exiting
Traceback (most recent call last):
File "./test_libvirt.py", line 37, in <module>
vm = c.createLinux(x, 0)
File "/usr/lib64/python2.5/site-packages/libvirt.py", line 892, in
createLinux
if ret is None:raise libvirtError('virDomainCreateLinux() failed',
conn=self)
libvirt.libvirtError: internal error QEMU quit during console startup
Run #2:
./test_libvirt.py
libvir: Remote error : socket closed unexpectedly
Traceback (most recent call last):
File "./test_libvirt.py", line 37, in <module>
vm = c.createLinux(x, 0) # what a lousy function name
File "/usr/lib64/python2.5/site-packages/libvirt.py", line 892, in
createLinux
if ret is None:raise libvirtError('virDomainCreateLinux() failed',
conn=self)
libvirt.libvirtError: socket closed unexpectedly
libvir: Remote error : Broken pipe
Code:
#!/usr/bin/env python
import libvirt
c = libvirt.open('qemu:///system')
x = """<domain type='kvm'>
<name>yossi2</name>
<memory>512000</memory> <currentMemory>512000</currentMemory>
<vcpu>1</vcpu>
<os> <type arch='i686' machine='pc'>hvm</type> <boot dev='hd'/>
</os>
<features> <acpi/> </features>
<clock offset='utc'/>
<devices>
<emulator>/usr/bin/qemu-kvm</emulator>
<disk type='file' device='disk'>
<source file='/mnt/sda2/images/winxp-acpi.vmdk'/>
<target dev='hda' bus='ide'/>
</disk>
<input type='tablet' bus='usb'/> <input type='mouse' bus='ps2'/>
<graphics type='sdl'/>
</devices>
</domain>"""
vm = c.createLinux(x, 0)
Thanks,
Itamar
15 years, 10 months
[libvirt] FYI: Fixed multiple test driver crashes/flaws
by Daniel P. Berrange
The virt-install test suite exposed a number of bugs in the test
driver storage APIs, partly due to my threading changes. There
was one deadlock (calling unneccessary PoolRefresh op), one
crash (deferencing a variable we just set to NULL), and integer
long long overflow on 32-bit, and missing return value
I've committed the following patch which fixes these and makes
virt=install test suite work again
Daniel
diff -u -p -r1.103 -r1.106
--- src/test.c 4 Dec 2008 21:00:50 -0000 1.103
+++ src/test.c 7 Dec 2008 20:45:28 -0000 1.106
@@ -191,7 +191,7 @@ static const char *defaultPoolXML =
" </target>"
"</pool>";
-static const unsigned long long defaultPoolCap = (100 * 1024 * 1024 * 1024ul);
+static const unsigned long long defaultPoolCap = (100 * 1024 * 1024 * 1024ull);
static const unsigned long long defaultPoolAlloc = 0;
static int testStoragePoolObjSetDefaults(virStoragePoolObjPtr pool);
@@ -2323,9 +2323,6 @@ no_memory:
return -1;
}
-static int
-testStoragePoolRefresh(virStoragePoolPtr obj,
- unsigned int flags ATTRIBUTE_UNUSED);
static int
testStoragePoolStart(virStoragePoolPtr pool,
@@ -2350,8 +2347,6 @@ testStoragePoolStart(virStoragePoolPtr p
goto cleanup;
}
- if (testStoragePoolRefresh(pool, 0) == 0)
- goto cleanup;
privpool->active = 1;
ret = 0;
@@ -2506,6 +2501,7 @@ testStoragePoolBuild(virStoragePoolPtr p
_("storage pool '%s' is already active"), pool->name);
goto cleanup;
}
+ ret = 0;
cleanup:
if (privpool)
@@ -3001,10 +2997,10 @@ testStorageVolumeCreateXML(virStoragePoo
privpool->def->allocation);
privpool->volumes.objs[privpool->volumes.count++] = privvol;
- privvol = NULL;
ret = virGetStorageVol(pool->conn, privpool->def->name,
privvol->name, privvol->key);
+ privvol = NULL;
cleanup:
virStorageVolDefFree(privvol);
--
|: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :|
|: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|
15 years, 10 months