]> git.ipfire.org Git - thirdparty/libvirt.git/commit
snapshot: rudimentary qemu support for atomic disk snapshot
authorEric Blake <eblake@redhat.com>
Fri, 16 Mar 2012 21:17:13 +0000 (15:17 -0600)
committerEric Blake <eblake@redhat.com>
Fri, 23 Mar 2012 22:38:20 +0000 (16:38 -0600)
commit4c4cc1b96df70a7cffa9704524ff4af62bcf86d5
tree95ef4c3d330b99d73c922a7e1b214c2f6ece76a1
parent922d498e1c9cf11d814fc4f663e6d817dabe7703
snapshot: rudimentary qemu support for atomic disk snapshot

Taking an external snapshot of just one disk is atomic, without having
to pause and resume the VM.  This also paves the way for later patches
to interact with the new qemu 'transaction' monitor command.

The various scenarios when requesting atomic are:
online, 1 disk, old qemu - safe, allowed by this patch
online, more than 1 disk, old qemu - failure, this patch
offline snapshot - safe, once a future patch implements offline disk snapshot
online, 1 or more disks, new qemu - safe, once future patch uses transaction

Taking an online system checkpoint snapshot is atomic, since it is
done via a single 'savevm' monitor command.  Taking an offline system
checkpoint snapshot is atomic, thanks to the previous patch.

* src/qemu/qemu_driver.c (qemuDomainSnapshotCreateXML): Support
new flag for single-disk setups.
(qemuDomainSnapshotDiskPrepare): Check for atomic here.
(qemuDomainSnapshotCreateDiskActive): Skip pausing the VM when
atomic supported.
(qemuDomainSnapshotIsAllowed): Use bool instead of int.
src/qemu/qemu_driver.c