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