]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemuCheckpointDelete: 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 16:56:30 +0000 (17:56 +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 76f10a701eee9a4d73d7e724cccdb29fad8c6c7b..62b6e87b53012f4da1f42c32c90bf7e6b00d0cc2 100644 (file)
@@ -771,15 +771,15 @@ qemuCheckpointDelete(virDomainObjPtr vm,
         return -1;
 
     if (!metadata_only) {
-        if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_INCREMENTAL_BACKUP)) {
+        if (!virDomainObjIsActive(vm)) {
             virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
-                           _("incremental backup is not supported yet"));
+                           _("cannot delete checkpoint for inactive domain"));
             goto endjob;
         }
 
-        if (!virDomainObjIsActive(vm)) {
+        if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_INCREMENTAL_BACKUP)) {
             virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
-                           _("cannot delete checkpoint for inactive domain"));
+                           _("incremental backup is not supported yet"));
             goto endjob;
         }
     }