d0f569
From 94bc9eaf3bbcaec47bd233378bbbb45f5f1523ca Mon Sep 17 00:00:00 2001
d0f569
Message-Id: <94bc9eaf3bbcaec47bd233378bbbb45f5f1523ca@dist-git>
d0f569
From: =?UTF-8?q?J=C3=A1n=20Tomko?= <jtomko@redhat.com>
d0f569
Date: Thu, 20 Jan 2022 14:53:33 +0100
d0f569
Subject: [PATCH] qemu: fix inactive snapshot revert
d0f569
MIME-Version: 1.0
d0f569
Content-Type: text/plain; charset=UTF-8
d0f569
Content-Transfer-Encoding: 8bit
d0f569
d0f569
The commit splitting out the qemuSnapshotRevertInactive function
d0f569
dropped the 'defined = true' line by accident and instead
d0f569
returned -1, leaving the user with a cryptic error:
d0f569
error: An error occurred, but the cause is unknown
d0f569
d0f569
https://bugzilla.redhat.com/show_bug.cgi?id=2039136
d0f569
https://gitlab.com/libvirt/libvirt/-/issues/266
d0f569
d0f569
Fixes: 85e4a13c3f19078fb6af5ffb4a80022c142cbc7e
d0f569
Signed-off-by: Ján Tomko <jtomko@redhat.com>
d0f569
(cherry picked from commit 76deb656132bb8817ddae4b7f417930c4db824c9)
d0f569
d0f569
https://bugzilla.redhat.com/show_bug.cgi?id=2043584
d0f569
d0f569
Signed-off-by: Ján Tomko <jtomko@redhat.com>
d0f569
---
d0f569
 src/qemu/qemu_snapshot.c | 2 +-
d0f569
 1 file changed, 1 insertion(+), 1 deletion(-)
d0f569
d0f569
diff --git a/src/qemu/qemu_snapshot.c b/src/qemu/qemu_snapshot.c
d0f569
index f92e00f9c0..ac7bab90f8 100644
d0f569
--- a/src/qemu/qemu_snapshot.c
d0f569
+++ b/src/qemu/qemu_snapshot.c
d0f569
@@ -2193,7 +2193,7 @@ qemuSnapshotRevertInactive(virDomainObj *vm,
d0f569
 
d0f569
     if (*inactiveConfig) {
d0f569
         virDomainObjAssignDef(vm, inactiveConfig, false, NULL);
d0f569
-        return -1;
d0f569
+        defined = true;
d0f569
     }
d0f569
 
d0f569
     if (flags & (VIR_DOMAIN_SNAPSHOT_REVERT_RUNNING |
d0f569
-- 
d0f569
2.35.0
d0f569