]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: fix inactive snapshot revert
authorJán Tomko <jtomko@redhat.com>
Thu, 20 Jan 2022 13:53:33 +0000 (14:53 +0100)
committerJán Tomko <jtomko@redhat.com>
Thu, 20 Jan 2022 14:16:18 +0000 (15:16 +0100)
The commit splitting out the qemuSnapshotRevertInactive function
dropped the 'defined = true' line by accident and instead
returned -1, leaving the user with a cryptic error:
error: An error occurred, but the cause is unknown

https://bugzilla.redhat.com/show_bug.cgi?id=2039136
https://gitlab.com/libvirt/libvirt/-/issues/266

Fixes: 85e4a13c3f19078fb6af5ffb4a80022c142cbc7e
Signed-off-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_snapshot.c

index 9cf185026ca11698780c400cedce2cc31053cd03..1887c7070845ca0901f47bf40bff58869ec5a307 100644 (file)
@@ -2190,7 +2190,7 @@ qemuSnapshotRevertInactive(virDomainObj *vm,
 
     if (*inactiveConfig) {
         virDomainObjAssignDef(vm, inactiveConfig, false, NULL);
-        return -1;
+        defined = true;
     }
 
     if (flags & (VIR_DOMAIN_SNAPSHOT_REVERT_RUNNING |