On 08/12/2011 07:30 AM, Eric Blake wrote:
A future patch will make it impossible to remove a domain if it
would leave behind any libvirt-tracked metadata about snapshots,
since stale metadata interferes with a new domain by the same name.
But requiring snaphot contents to be deleted before removing a
domain is harsh; with qemu, qemu-img can still make use of the
contents after the libvirt domain is gone. Therefore, we need
an option to get rid of libvirt tracking information, but not
the actual contents. For hypervisors that do not track any
metadata in libvirt, the implementation is trivial; all remaining
hypervisors (really, just qemu) will be dealt with separately.
+++ b/include/libvirt/libvirt.h.in
@@ -2580,6 +2580,7 @@ int virDomainRevertToSnapshot(virDomainSnapshotPtr snapshot,
/* Delete a snapshot */
typedef enum {
VIR_DOMAIN_SNAPSHOT_DELETE_CHILDREN = (1<< 0),
+ VIR_DOMAIN_SNAPSHOT_DELETE_METADATA_ONLY = (2<< 0),
Don't know what came over me today :) '2 << 0' happens to be the same
as '1 << 1', but it is the wrong pattern (since by continuing the
pattern, 3 << 0 is _not_ the same as 1 << 2).
--
Eric Blake eblake(a)redhat.com +1-801-349-2682
Libvirt virtualization library
http://libvirt.org