mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-25 07:05:28 +00:00
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 <pkrempa@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
parent
e060b0624d
commit
4257c20373
@ -647,18 +647,18 @@ qemuCheckpointCreateXML(virDomainPtr domain,
|
|||||||
update_current = false;
|
update_current = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_INCREMENTAL_BACKUP)) {
|
|
||||||
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
|
|
||||||
_("incremental backup is not supported yet"));
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!virDomainObjIsActive(vm)) {
|
if (!virDomainObjIsActive(vm)) {
|
||||||
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
|
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
|
||||||
_("cannot create checkpoint for inactive domain"));
|
_("cannot create checkpoint for inactive domain"));
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_INCREMENTAL_BACKUP)) {
|
||||||
|
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
|
||||||
|
_("incremental backup is not supported yet"));
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
if (!(def = virDomainCheckpointDefParseString(xmlDesc, driver->xmlopt,
|
if (!(def = virDomainCheckpointDefParseString(xmlDesc, driver->xmlopt,
|
||||||
priv->qemuCaps, parse_flags)))
|
priv->qemuCaps, parse_flags)))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
Loading…
Reference in New Issue
Block a user