]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemuCheckpointCreateXML: Check VM liveness first
authorPeter Krempa <pkrempa@redhat.com>
Thu, 26 Mar 2020 14:20:44 +0000 (15:20 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Thu, 26 Mar 2020 17:21:15 +0000 (18:21 +0100)
Move the liveness check prior to the capability check. If the VM is
offline the capabilities are not initialized and thus we'd report the
wrong error.

https://bugzilla.redhat.com/show_bug.cgi?id=1812531

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
src/qemu/qemu_checkpoint.c

index 62b6e87b53012f4da1f42c32c90bf7e6b00d0cc2..3a510c9780979ed1ce444b4f3b68ac522ce68d2b 100644 (file)
@@ -647,15 +647,15 @@ qemuCheckpointCreateXML(virDomainPtr domain,
         update_current = false;
     }
 
-    if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_INCREMENTAL_BACKUP)) {
+    if (!virDomainObjIsActive(vm)) {
         virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
-                       _("incremental backup is not supported yet"));
+                       _("cannot create checkpoint for inactive domain"));
         return NULL;
     }
 
-    if (!virDomainObjIsActive(vm)) {
+    if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_INCREMENTAL_BACKUP)) {
         virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
-                       _("cannot create checkpoint for inactive domain"));
+                       _("incremental backup is not supported yet"));
         return NULL;
     }