From: Peter Krempa Date: Thu, 26 Mar 2020 14:20:44 +0000 (+0100) Subject: qemuCheckpointCreateXML: Check VM liveness first X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=4257c203737e5ef616588e80794cc705a5fb475a;p=libvirt.git qemuCheckpointCreateXML: 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 62b6e87b53..3a510c9780 100644 --- a/src/qemu/qemu_checkpoint.c +++ b/src/qemu/qemu_checkpoint.c @@ -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; }