]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: Fix regression with undefine --snapshots-metadata
authorEric Blake <eblake@redhat.com>
Fri, 10 May 2019 14:38:31 +0000 (09:38 -0500)
committerEric Blake <eblake@redhat.com>
Fri, 10 May 2019 15:50:16 +0000 (10:50 -0500)
In refactoring the snapshot code to prepare for checkpoints, I changed
qemuDomainMomentDiscardAll to take a callback that would handle the
cleanup of either a snapshot or a checkpoint, but failed to set the
callback on one of the two snapshot callers.  As a result, 'virsh
undefine $dom --snapshots-metadata' crashed on a NULL function
dereference.

Fixes: a487890d371b8cc3662c1717dfe07eea3f1ef1c0
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1707708
Signed-off-by: Eric Blake <eblake@redhat.com>
Acked-by: Peter Krempa <pkrempa@redhat.com>
src/qemu/qemu_domain.c

index 2af17816c6ac4ac993b9eba6dbc6d262dd7136c7..3290c5d490e3ae7e9ed66e61f51b3a8f04c09366 100644 (file)
@@ -8664,7 +8664,8 @@ qemuDomainSnapshotDiscardAllMetadata(virQEMUDriverPtr driver,
     virQEMUMomentRemove rem = {
         .driver = driver,
         .vm = vm,
-        .metadata_only = true
+        .metadata_only = true,
+        .momentDiscard = qemuDomainSnapshotDiscard,
     };
 
     virDomainSnapshotForEach(vm->snapshots, qemuDomainMomentDiscardAll, &rem);