Libvirt provides a portable, long term stable C API for managing the virtualization technologies provided by many operating systems. It includes support for QEMU, KVM, Xen, LXC, bhyve, Virtuozzo, VMware vCenter and ESX, VMware Desktop, Hyper-V, VirtualBox and the POWER Hypervisor.
Go to file
Eric Blake 6b75a1a5b0 virsh: list required options first
The current state of virsh parsing is that:

$ virsh vol-info /path/to/image
$ virsh vol-info --pool default /path/to/image
$ virsh vol-info --pool default --vol /path/to/image

all lookup the volume by path (technically, the last two also attempt
a name lookup within a pool, whereas the first skips that step, but
the end result is the same); meanwhile:

$ virsh vol-info default /path/to/image

complains about unexpected data.  Why?  Because the --pool option is
optional, so default was parsed as the --vol argument, and
/path/to/image.img doesn't match up with any remaining options that
require an argument.  For proof, note that:

$ virsh vol-info default --vol /path/to/image

complains about looking up 'default' - the parser mis-associated both
arguments with --vol.  Given the above, the only way to specify pool
is with an explicit "--pool" argument (you can't specify it
positionally).  However, named arguments can appear in any order, so:

$ virsh vol-info /path/to/image --pool default
$ virsh vol-info --vol /path/to/image --pool default

have also always worked.  Therefore, this patch has no functional
change on vol-info option parsing, but only on 'virsh help vol-info'
synopsis layout.  However, it also allows the next patch to 1) enforce
that required options are always first (without this patch, the next
patch would fail the testsuite), and 2) allow the user to omit the
"--pool" argument.  That is, the next patch makes it possible to do:

$ virsh vol-info /path/to/image default

which to date was not possible.

* tools/virsh.c (opts_vol_create_from, opts_vol_clone)
(opts_vol_upload, opts_vol_download, opts_vol_delete)
(opts_vol_wipe, opts_vol_info, opts_vol_dumpxml, opts_vol_key)
(opts_vol_path): List optional pool parameter after required
arguments.
2011-04-15 15:39:53 -06:00
.gnulib@fb799692f5 maint: fix grammar errors 2011-04-12 09:06:14 -06:00
daemon Replace REMOTE_DEBUG with VIR_DEBUG in daemon dispatcher 2011-04-13 19:01:24 +01:00
docs Spice: support audio, images and stream compression 2011-04-14 10:23:59 -06:00
examples Fix domain events C example on Win32 2011-03-31 16:01:49 +01:00
include maint: fix grammar errors 2011-04-12 09:06:14 -06:00
m4 build: fix gitignore sorting 2011-04-07 15:03:53 -06:00
po Release of libvirt-0.9.0 2011-04-04 20:15:45 +08:00
python python: Use hardcoded python path in libvirt.py 2011-03-14 12:37:19 +01:00
src phyp: avoid memory leaks in command values 2011-04-15 15:32:19 -06:00
tests Introduce virDomainChrDefNew() 2011-04-14 10:29:39 -06:00
tools virsh: list required options first 2011-04-15 15:39:53 -06:00
.dir-locals.el maint: make spacing in .sh files easier 2011-03-14 21:57:42 -06:00
.gitignore build: fix gitignore sorting 2011-04-07 15:03:53 -06:00
.gitmodules make .gnulib a submodule 2009-07-08 16:17:51 +02:00
.mailmap Fix gcc 4.6 warnings 2011-04-14 19:09:12 +02:00
AUTHORS libvirt-guests: implement START_DELAY 2011-04-15 11:15:06 -06:00
autobuild.sh Remove the Open Nebula driver 2011-03-28 14:09:11 +01:00
autogen.sh build: avoid problems with autogen.sh runs from tarball 2011-02-12 06:28:28 -07:00
bootstrap build: fix gitignore sorting 2011-04-07 15:03:53 -06:00
bootstrap.conf Migrate VMs between different-endianess hosts 2011-04-14 14:48:03 -04:00
cfg.mk maint: fix grammar errors 2011-04-12 09:06:14 -06:00
ChangeLog-old generate ChangeLog from git logs into distribution tarball 2009-07-08 16:17:51 +02:00
configure.ac Use gnulib's manywarnings & warnings modules 2011-04-05 11:39:35 +01:00
COPYING.LIB remove all trailing blank lines 2009-07-16 15:06:42 +02:00
HACKING docs: mention C89 syntax preferences 2011-03-30 13:51:22 -06:00
libvirt.pc.in * libvirt.pc.in: applied patch from Daniel Berrange to fix --cflags 2006-03-24 13:18:12 +00:00
libvirt.spec.in Fix typo in systemtap tapset directory name 2011-04-05 17:44:12 +01:00
Makefile.am build: nuke all .x-sc* files, and fix VPATH syntax-check 2011-03-23 15:51:32 -06:00
Makefile.nonreentrant Ban use of all inet_* functions 2010-10-22 11:59:23 +01:00
mingw32-libvirt.spec.in Remove iohelper on Win32 since it is not required 2011-03-31 17:41:51 +01:00
README Correct typos in the documentation (Atsushi SAKAI) 2008-01-24 10:15:13 +00:00
README-hacking maint: relax git minimum version 2010-02-24 14:29:27 -05:00
TODO Update todo list file to point at bugzilla/website 2010-10-13 16:45:26 +01:00

         LibVirt : simple API for virtualization

  Libvirt is a C toolkit to interact with the virtualization capabilities
of recent versions of Linux (and other OSes). It is free software
available under the GNU Lesser General Public License. Virtualization of
the Linux Operating System means the ability to run multiple instances of
Operating Systems concurrently on a single hardware system where the basic
resources are driven by a Linux instance. The library aim at providing
long term stable C API initially for the Xen paravirtualization but
should be able to integrate other virtualization mechanisms if needed.

Daniel Veillard <veillard@redhat.com>