From: Peter Krempa Date: Thu, 26 Mar 2020 14:20:44 +0000 (+0100) Subject: qemuCheckpointDelete: Check VM liveness first X-Git-Tag: v6.2.0-rc1~29 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e05dd1abdc3b3eeac6e12ab105e56138d783af2a;p=thirdparty%2Flibvirt.git qemuCheckpointDelete: Check VM liveness first 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 Reviewed-by: Eric Blake --- diff --git a/src/qemu/qemu_checkpoint.c b/src/qemu/qemu_checkpoint.c index 76f10a701e..62b6e87b53 100644 --- a/src/qemu/qemu_checkpoint.c +++ b/src/qemu/qemu_checkpoint.c @@ -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; } }