]> xenbits.xensource.com Git - libvirt.git/commit
snapshot: introduce new deletion flag
authorEric Blake <eblake@redhat.com>
Tue, 16 Aug 2011 22:23:45 +0000 (16:23 -0600)
committerEric Blake <eblake@redhat.com>
Mon, 5 Sep 2011 13:03:04 +0000 (07:03 -0600)
commit3d77d0a644d87185d4044b69e536ffcdd40eee6c
treebcbea8e3ad7802c5d76d81ab8f0dda98f31bfc49
parente91d27ee450cd03f273e1e91e0922fe2ce007efc
snapshot: introduce new deletion flag

Reverting to a state prior to an external snapshot risks
corrupting any other branches in the snapshot hierarchy that
were using the snapshot as a read-only backing file.  So
disk snapshot code will default to preventing reverting to
a snapshot that has any children, meaning that deleting just
the children of a snapshot becomes a useful operation in
preparing that snapshot for being a future reversion target.
The code for the new flag is simple - it's one less deletion,
plus a tweak to keep the current snapshot correct.

* include/libvirt/libvirt.h.in
(VIR_DOMAIN_SNAPSHOT_DELETE_CHILDREN_ONLY): New flag.
* src/libvirt.c (virDomainSnapshotDelete): Document it, and
enforce mutual exclusion.
* src/qemu/qemu_driver.c (qemuDomainSnapshotDelete): Implement
it.
include/libvirt/libvirt.h.in
src/libvirt.c
src/qemu/qemu_driver.c