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 d42a2ffc07 snapshot: improve qemu handling of reused snapshot targets
The oVirt developers have stated that the real reasons they want
to have qemu reuse existing volumes when creating a snapshot are:
1. the management framework is set up so that creation has to be
done from a central node for proper resource tracking, and having
libvirt and/or qemu create things violates the framework, and
2. qemu defaults to creating snapshots with an absolute path to
the backing file, but oVirt wants to manage a backing chain that
uses just relative names, to allow for easier migration of a chain
across storage locations.

When 0.9.10 added VIR_DOMAIN_SNAPSHOT_CREATE_REUSE_EXT (commit
4e9953a4), it only addressed point 1, but libvirt was still using
O_TRUNC which violates point 2.  Meanwhile, the new qemu
'transaction' monitor command includes a new optional mode argument
that will force qemu to reuse the metadata of the file it just
opened (with the burden on the caller to have valid metadata there
in the first place).  So, this tweaks the meaning of the flag to
cover both points as intended for use by oVirt.  It is not strictly
backward-compatible to 0.9.10 behavior, but it can be argued that
the O_TRUNC of 0.9.10 was a bug.

Note that this flag is all-or-nothing, and only selects between
'existing' and the default 'absolute-paths'.  A more flexible
approach that would allow per-disk selections, as well as adding
support for the 'no-backing-file' mode, would be possible by
extending the <domainsnapshot> xml to have a per-disk mode, but
until we have a management application expressing a need for that
additional complexity, it is not worth doing.

* src/libvirt.c (virDomainSnapshotCreateXML): Tweak documentation.
* src/qemu/qemu_monitor.h (qemuMonitorDiskSnapshot): Add
parameters.
* src/qemu/qemu_monitor_json.h (qemuMonitorJSONDiskSnapshot):
Likewise.
* src/qemu/qemu_monitor.c (qemuMonitorDiskSnapshot): Pass them
through.
* src/qemu/qemu_monitor_json.c (qemuMonitorJSONDiskSnapshot): Use
new monitor command arguments.
* src/qemu/qemu_driver.c (qemuDomainSnapshotCreateDiskActive)
(qemuDomainSnapshotCreateSingleDiskActive): Adjust callers.
(qemuDomainSnapshotDiskPrepare): Allow qed, modify rules on reuse.
2012-03-23 16:38:20 -06:00
.gnulib@d5612c714c build: prohibit cross-inclusion 2012-03-02 06:22:43 -07:00
daemon Add support for the suspend event 2012-03-23 23:12:18 +08:00
docs docs: Add documentation for new attribute tray of disk target 2012-03-23 23:10:30 +08:00
examples qemu: Update domain status to running while wakeup event is emitted 2012-03-23 23:12:29 +08:00
gnulib build: update to latest gnulib 2012-01-12 15:47:54 -07:00
include snapshot: add atomic create flag 2012-03-23 16:38:20 -06:00
m4 build: silence some compiler warnings from gnulib 2012-01-19 13:14:10 -07:00
po Add helper API for finding auth file path 2012-03-23 13:24:07 +00:00
python Add support for the suspend event 2012-03-23 23:12:18 +08:00
src snapshot: improve qemu handling of reused snapshot targets 2012-03-23 16:38:20 -06:00
tests build: drop obsolete qparams test 2012-03-23 16:12:58 -06:00
tools snapshot: add atomic create flag 2012-03-23 16:38:20 -06:00
.dir-locals.el maint: let emacs avoid tabs in rng files 2011-08-13 08:56:26 -06:00
.gitignore build: drop obsolete qparams test 2012-03-23 16:12:58 -06:00
.gitmodules make .gnulib a submodule 2009-07-08 16:17:51 +02:00
.mailmap maint: prune duplicate listings in AUTHORS 2012-02-03 09:56:45 -07:00
AUTHORS Add qemu support for ppc64 on FC16 or above for rpm packaging 2012-03-23 12:40:13 -04:00
autobuild.sh Disable python explicitly in mingw32 autobuild 2011-12-19 13:44:18 +00:00
autogen.sh build: allow for local gnulib diffs 2011-11-09 09:03:33 -07:00
bootstrap build: update to latest gnulib 2012-02-29 10:27:40 -07:00
bootstrap.conf build: drop a painfully long gnulib test 2012-03-21 11:12:30 -06:00
cfg.mk build: use correct type for pid and similar types 2012-03-02 06:57:43 -07:00
ChangeLog-old virterror.c: Fix several spelling mistakes 2012-02-03 11:32:51 -07:00
configure.ac qemu: Support numad 2012-03-15 12:24:56 +08:00
COPYING.LIB remove all trailing blank lines 2009-07-16 15:06:42 +02:00
HACKING Document STREQ_NULLABLE and STRNEQ_NULLABLE 2011-10-06 16:50:38 +02:00
libvirt.pc.in Fix typos in API XML file paths 2012-02-15 11:29:38 +00:00
libvirt.spec.in Add qemu support for ppc64 on FC16 or above for rpm packaging 2012-03-23 12:40:13 -04:00
Makefile.am maint: add missing copyright notices 2011-07-28 15:01:17 -06:00
Makefile.nonreentrant Ban use of all inet_* functions 2010-10-22 11:59:23 +01:00
mingw32-libvirt.spec.in Fix typos in API XML file paths 2012-02-15 11:29:38 +00: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>