render / rpms / libvirt

Forked from rpms/libvirt 10 months ago
Clone
a41c76
From 5155fcbbff955e9c1446b3564af2252a5c15548a Mon Sep 17 00:00:00 2001
a41c76
Message-Id: <5155fcbbff955e9c1446b3564af2252a5c15548a@dist-git>
a41c76
From: Peter Krempa <pkrempa@redhat.com>
a41c76
Date: Fri, 3 Apr 2020 14:32:56 +0200
a41c76
Subject: [PATCH] qemuCheckpointCreateXML: Check VM liveness first
a41c76
MIME-Version: 1.0
a41c76
Content-Type: text/plain; charset=UTF-8
a41c76
Content-Transfer-Encoding: 8bit
a41c76
a41c76
Move the liveness check prior to the capability check. If the VM is
a41c76
offline the capabilities are not initialized and thus we'd report the
a41c76
wrong error.
a41c76
a41c76
https://bugzilla.redhat.com/show_bug.cgi?id=1812531
a41c76
a41c76
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
a41c76
Reviewed-by: Eric Blake <eblake@redhat.com>
a41c76
(cherry picked from commit 4257c203737e5ef616588e80794cc705a5fb475a)
a41c76
a41c76
Note that this patch is backported as a conflict resolution for the bugs
a41c76
below
a41c76
a41c76
https://bugzilla.redhat.com/show_bug.cgi?id=1819755
a41c76
a41c76
Message-Id: <94fcc1654f3e2fb2d4c1da07347d686180bac532.1585916255.git.pkrempa@redhat.com>
a41c76
Reviewed-by: Ján Tomko <jtomko@redhat.com>
a41c76
---
a41c76
 src/qemu/qemu_checkpoint.c | 8 ++++----
a41c76
 1 file changed, 4 insertions(+), 4 deletions(-)
a41c76
a41c76
diff --git a/src/qemu/qemu_checkpoint.c b/src/qemu/qemu_checkpoint.c
a41c76
index 19822bd74d..16480518fa 100644
a41c76
--- a/src/qemu/qemu_checkpoint.c
a41c76
+++ b/src/qemu/qemu_checkpoint.c
a41c76
@@ -649,15 +649,15 @@ qemuCheckpointCreateXML(virDomainPtr domain,
a41c76
         update_current = false;
a41c76
     }
a41c76
 
a41c76
-    if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_INCREMENTAL_BACKUP)) {
a41c76
+    if (!virDomainObjIsActive(vm)) {
a41c76
         virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
a41c76
-                       _("incremental backup is not supported yet"));
a41c76
+                       _("cannot create checkpoint for inactive domain"));
a41c76
         return NULL;
a41c76
     }
a41c76
 
a41c76
-    if (!virDomainObjIsActive(vm)) {
a41c76
+    if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_INCREMENTAL_BACKUP)) {
a41c76
         virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
a41c76
-                       _("cannot create checkpoint for inactive domain"));
a41c76
+                       _("incremental backup is not supported yet"));
a41c76
         return NULL;
a41c76
     }
a41c76
 
a41c76
-- 
a41c76
2.26.0
a41c76