libvirt/src/qemu
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
..
libvirtd_qemu.aug Add two new security label types 2012-02-02 17:44:37 -07:00
MIGRATION.txt qemu: Implement migration job phases 2011-07-27 08:45:09 -06:00
qemu_agent.c qemu: Implement DomainPMSuspendForDuration 2012-02-15 11:45:45 +01:00
qemu_agent.h qemu: Implement DomainPMSuspendForDuration 2012-02-15 11:45:45 +01:00
qemu_bridge_filter.c Remove conn parameter from virReportSystemError 2010-02-09 01:04:54 +01:00
qemu_bridge_filter.h build: consistently indent preprocessor directives 2010-03-09 19:22:28 +01:00
qemu_capabilities.c snapshot: add qemu capability for 'transaction' command 2012-03-23 16:38:19 -06:00
qemu_capabilities.h snapshot: add qemu capability for 'transaction' command 2012-03-23 16:38:19 -06:00
qemu_cgroup.c qemu: eliminate "Ignoring open failure" when using root-squash NFS 2012-02-03 16:47:43 -05:00
qemu_cgroup.h qemu: Implement period and quota tunable XML configuration and parsing 2011-07-21 17:11:12 +08:00
qemu_command.c qemu: Prohibit setting tray status as open for block type disk 2012-03-23 23:12:02 +08:00
qemu_command.h build: use correct type for pid and similar types 2012-03-02 06:57:43 -07:00
qemu_conf.c qemu: Add connection close callbacks 2012-03-21 17:31:09 +01:00
qemu_conf.h qemu: Make autodestroy utilize connection close callbacks 2012-03-21 17:31:09 +01:00
qemu_domain.c snapshot: make offline qemu snapshots atomic 2012-03-23 16:38:20 -06:00
qemu_domain.h qemu: Avoid dangling migration-in job on shutoff domains 2012-03-21 17:31:09 +01:00
qemu_driver.c snapshot: improve qemu handling of reused snapshot targets 2012-03-23 16:38:20 -06:00
qemu_driver.h Split all QEMU process mangement code into separate file 2011-02-17 12:48:55 +00:00
qemu_hostdev.c qemu: install port profile and mac address on netdev hostdevs 2012-03-06 06:04:04 -05:00
qemu_hostdev.h qemu: install port profile and mac address on netdev hostdevs 2012-03-06 06:04:04 -05:00
qemu_hotplug.c qemuDomainDetachPciDiskDevice: Free allocated cgroup 2012-03-15 17:10:22 +01:00
qemu_hotplug.h qemu: Don't drop hostdev config until security label restore 2011-12-16 11:53:03 +01:00
qemu_migration.c Centralize error reporting for URI parsing/formatting problems 2012-03-23 12:59:21 +00:00
qemu_migration.h qemu: Avoid dangling migration-out job when client dies 2012-03-21 17:31:09 +01:00
qemu_monitor_json.c snapshot: improve qemu handling of reused snapshot targets 2012-03-23 16:38:20 -06:00
qemu_monitor_json.h snapshot: improve qemu handling of reused snapshot targets 2012-03-23 16:38:20 -06:00
qemu_monitor_text.c xml: use better types for memory values 2012-03-07 18:24:44 -07:00
qemu_monitor_text.h xml: use better types for memory values 2012-03-07 18:24:44 -07:00
qemu_monitor.c snapshot: improve qemu handling of reused snapshot targets 2012-03-23 16:38:20 -06:00
qemu_monitor.h snapshot: improve qemu handling of reused snapshot targets 2012-03-23 16:38:20 -06:00
qemu_process.c qemu: Update domain status to running while wakeup event is emitted 2012-03-23 23:12:29 +08:00
qemu_process.h qemu: Fix startupPolicy for snapshot-revert 2012-03-08 10:03:08 +01:00
qemu.conf qemu driver for virDomainGetCPUstats using cpuacct cgroup. 2012-03-06 21:54:48 -07:00
test_libvirtd_qemu.aug qemu: Support for overriding NOFILE limit 2011-12-22 17:49:04 +01:00
THREADS.txt qemu: fix crash when mixing sync and async monitor jobs 2011-08-01 09:41:57 -06:00