libvirt/tools
Eric Blake b298025063 blockcommit: document semantics of committing active layer
Now that qemu 2.0 allows commit of the active layer, people are
attempting to use virsh blockcommit and getting into a stuck
state, because libvirt is unprepared to handle the two-phase
commit required by qemu.

Stepping back a bit, there are two valid semantics for a
commit operation:

1. Maintain a 'golden' base, and a transient overlay. Make
changes in the overlay, and if everything appears to work,
commit those changes into the base, but still keep the overlay
for the next round of changes; repeat the cycle as desired.

2. Create an external snapshot, then back up the stable state
in the backing file. Once the backup is complete, commit the
overlay back into the base, and delete the temporary snapshot.

Since qemu doesn't know up front which of the two styles is
preferred, a block commit of the active layer merely gets
the job into a synchronized state, and sends an event; then
the user must either cancel (case 1) or complete (case 2),
where qemu then sends a second event that actually ends the
job.  However, until commit e6bcbcd, libvirt was blindly
assuming the semantics that apply to a commit of an
intermediate image, where there is only one sane conclusion
(the job automatically ends with fewer elements in the chain);
and getting stuck because it wasn't prepared for qemu to enter
a second phase of the job.

This patch adds a flag to the libvirt API that a user MUST
supply in order to acknowledge that they will be using two-phase
semantics.  It might be possible to have a mode where if the
flag is omitted, we automatically do the case 2 semantics on
the user's behalf; but before that happens, I must do additional
patches to track the fact that we are doing an active commit
in the domain XML.  Later patches will add support of the flag,
and once 2-phase semantics are working, we can then decide
whether to relax things to allow an omitted flag to cause an
automatic pivot.

* include/libvirt/libvirt.h.in (VIR_DOMAIN_BLOCK_COMMIT_ACTIVE)
(VIR_DOMAIN_BLOCK_JOB_TYPE_ACTIVE_COMMIT): New enums.
* src/libvirt.c (virDomainBlockCommit): Document two-phase job
when committing active layer, through new flag.
(virDomainBlockJobAbort): Document that pivot also occurs after
active commit.
* tools/virsh-domain.c (vshDomainBlockJob): Cover new job.
* src/qemu/qemu_driver.c (qemuDomainBlockCommit): Explicitly
reject active copy; later patches will add it in.

Signed-off-by: Eric Blake <eblake@redhat.com>
2014-06-10 11:11:16 -06:00
..
wireshark Indent top-level labels by one space in tools/ 2014-03-25 14:58:41 +01:00
libvirt_win_icon_16x16.ico Move virsh into tools/ directory 2009-09-21 14:41:45 +01:00
libvirt_win_icon_32x32.ico Move virsh into tools/ directory 2009-09-21 14:41:45 +01:00
libvirt_win_icon_48x48.ico Move virsh into tools/ directory 2009-09-21 14:41:45 +01:00
libvirt_win_icon_64x64.ico Move virsh into tools/ directory 2009-09-21 14:41:45 +01:00
libvirt-guests.init.in tools: Only install guests init script if --with-init=script=redhat 2012-12-11 19:54:37 -05:00
libvirt-guests.service.in Add Documentation fields to systemd service files 2014-01-09 09:32:55 +01:00
libvirt-guests.sh.in libvirt-guests: avoid bashism 2014-04-07 12:51:05 +02:00
libvirt-guests.sysconf libvirt-guests: Add parallel startup and shutdown of guests 2012-03-05 13:18:24 +01:00
Makefile.am conf: move storage source type to util/ 2014-04-01 10:38:14 -06:00
virsh_win_icon.rc Move virsh into tools/ directory 2009-09-21 14:41:45 +01:00
virsh-console.c Indent top-level labels by one space in tools/ 2014-03-25 14:58:41 +01:00
virsh-console.h virsh: Rename vshMakeStdinRaw to vshTTYMakeRaw and move it to virsh.c 2013-09-03 14:06:11 +02:00
virsh-domain-monitor.c build: nuke more uses of 'sync' 2014-05-19 17:07:47 -06:00
virsh-domain-monitor.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
virsh-domain.c blockcommit: document semantics of committing active layer 2014-06-10 11:11:16 -06:00
virsh-domain.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
virsh-edit.c Indent top-level labels by one space in tools/ 2014-03-25 14:58:41 +01:00
virsh-host.c Implement pretty flag for vcpuinfo and nodecpumap 2014-06-06 14:35:19 +02:00
virsh-host.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
virsh-interface.c Indent top-level labels by one space in tools/ 2014-03-25 14:58:41 +01:00
virsh-interface.h Change file names in comments to match the files they are in 2014-03-10 14:26:04 +01:00
virsh-network.c virsh: fix 'help event' 2014-03-31 08:37:39 -06:00
virsh-network.h Change file names in comments to match the files they are in 2014-03-10 14:26:04 +01:00
virsh-nodedev.c virsh-nodedev: Avoid spurious errors 2014-06-02 18:09:09 +02:00
virsh-nodedev.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
virsh-nwfilter.c Indent top-level labels by one space in tools/ 2014-03-25 14:58:41 +01:00
virsh-nwfilter.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
virsh-pool.c conf: use typedefs for enums in "src/conf/storage_conf.h" 2014-05-14 10:18:35 -06:00
virsh-pool.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
virsh-secret.c maint: shorten 'TypeType' function names 2014-05-16 00:22:18 -06:00
virsh-secret.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
virsh-snapshot.c Indent top-level labels by one space in tools/ 2014-03-25 14:58:41 +01:00
virsh-snapshot.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
virsh-volume.c virsh: Check whether found volume is member of the specified storage pool 2014-06-02 10:56:49 +02:00
virsh-volume.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
virsh.c Activate build dir overrides in libvirtd, virtlockd, virsh & tests 2014-04-25 11:59:32 +01:00
virsh.h virsh: Fix comment of vshCmdInfo 2014-04-09 16:29:58 +02:00
virsh.pod Implement pretty flag for vcpuinfo and nodecpumap 2014-06-06 14:35:19 +02:00
virt-host-validate-common.c Introduce OOM reporting to virAsprintf 2013-07-10 11:07:31 +02:00
virt-host-validate-common.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
virt-host-validate-lxc.c maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
virt-host-validate-lxc.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
virt-host-validate-qemu.c maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
virt-host-validate-qemu.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
virt-host-validate.c Change file names in comments to match the files they are in 2014-03-10 14:26:04 +01:00
virt-login-shell.c Indent top-level labels by one space in tools/ 2014-03-25 14:58:41 +01:00
virt-login-shell.conf Introduce a virt-login-shell binary 2013-08-08 16:36:31 +01:00
virt-login-shell.pod virt-login-shell: saner exit value 2014-03-03 12:40:32 -07:00
virt-pki-validate.in virt-pki-validate: add --help/--version option 2013-08-19 20:25:53 -06:00
virt-sanlock-cleanup.in virt-sanlock-cleanup; Fix augtool usage 2013-08-28 13:50:10 +02:00
virt-xml-validate.in tools: add missing 'interface' type and update man page 2013-09-13 14:57:52 +02:00