]> git.ipfire.org Git - thirdparty/libvirt.git/commit
snapshot: allow halting after snapshot
authorEric Blake <eblake@redhat.com>
Thu, 1 Sep 2011 23:23:29 +0000 (17:23 -0600)
committerEric Blake <eblake@redhat.com>
Mon, 5 Sep 2011 13:03:04 +0000 (07:03 -0600)
commit6f66423e1734120fc42339d5733e492b7d24d66e
tree13043e160b2ca92c5c3a85e298f210d25d789ac3
parentddc882733a11295c3325bbe8392feaa8c18a63fd
snapshot: allow halting after snapshot

Since a snapshot is fully recoverable, it is useful to have a
snapshot as a means of hibernating a guest, then reverting to
the snapshot to wake the guest up.  This mode of usage is
similar to 'virsh save/virsh restore', except that virsh
save uses an external file while virsh snapshot keeps the
vm state internal to a qcow2 file.  However, it only works on
persistent domains.

In the usage pattern of snapshot/revert for hibernating a guest,
there is no need to keep the guest running between the two points
in time, especially since that would generate runtime state that
would just be discarded.  Add a flag to make it possible to
stop the domain after the snapshot has completed.

* include/libvirt/libvirt.h.in (VIR_DOMAIN_SNAPSHOT_CREATE_HALT):
New flag.
* src/libvirt.c (virDomainSnapshotCreateXML): Document it.
* src/qemu/qemu_driver.c (qemuDomainSnapshotCreateXML)
(qemuDomainSnapshotCreateActive): Implement it.
include/libvirt/libvirt.h.in
src/libvirt.c
src/qemu/qemu_driver.c