[libvirt] [PATCH] qemu: Fix regression with undefine --snapshots-metadata

Eric Blake posted 1 patch 10 weeks ago
Test syntax-check passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/20190510144205.13352-1-eblake@redhat.com
src/qemu/qemu_domain.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

[libvirt] [PATCH] qemu: Fix regression with undefine --snapshots-metadata

Posted by Eric Blake 10 weeks ago
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
Signed-off-by: Eric Blake <eblake@redhat.com>
---
 src/qemu/qemu_domain.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 2af17816c6..3290c5d490 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -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);
-- 
2.20.1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH] qemu: Fix regression with undefine --snapshots-metadata

Posted by Peter Krempa 10 weeks ago
On Fri, May 10, 2019 at 09:42:05 -0500, Eric Blake wrote:
> 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
> Signed-off-by: Eric Blake <eblake@redhat.com>
> ---
>  src/qemu/qemu_domain.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

ACK
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list