From: Peter Krempa Date: Thu, 26 Sep 2019 12:08:11 +0000 (+0200) Subject: qemu: domain: Base block job interlocking on QEMU_CAPS_INCREMENTAL_BACKUP X-Git-Tag: v5.8.0-rc1~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6227d9806f6dab8bf105908a327b20e9b7b838b3;p=thirdparty%2Flibvirt.git qemu: domain: Base block job interlocking on QEMU_CAPS_INCREMENTAL_BACKUP The QEMU_CAPS_INCREMENTAL_BACKUP will be enabled once all bits of the incremental backup feature work as expected which means also properly interacting with blockjobs and snapshots. Thus we can allow blockjobs and snapshots if QEMU_CAPS_INCREMENTAL_BACKUP is present even when checkpoints exist. Signed-off-by: Peter Krempa Reviewed-by: Eric Blake --- diff --git a/src/qemu/qemu_checkpoint.c b/src/qemu/qemu_checkpoint.c index ac6328afa9..7b305d035a 100644 --- a/src/qemu/qemu_checkpoint.c +++ b/src/qemu/qemu_checkpoint.c @@ -377,12 +377,6 @@ qemuCheckpointCreateXML(virDomainPtr domain, update_current = false; } - if (virDomainSnapshotObjListNum(vm->snapshots, NULL, 0) > 0) { - virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", - _("cannot create checkpoint while snapshot exists")); - return NULL; - } - if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_INCREMENTAL_BACKUP)) { virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", _("incremental backup is not supported yet")); diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index c9c1bb4276..24c8896ceb 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -15526,7 +15526,10 @@ qemuDomainDefHasManagedPR(virDomainObjPtr vm) int qemuDomainSupportsCheckpointsBlockjobs(virDomainObjPtr vm) { - if (virDomainListCheckpoints(vm->checkpoints, NULL, NULL, NULL, 0) > 0) { + qemuDomainObjPrivatePtr priv = vm->privateData; + + if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_INCREMENTAL_BACKUP) && + virDomainListCheckpoints(vm->checkpoints, NULL, NULL, NULL, 0) > 0) { virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", _("cannot perform block operations while checkpoint exists")); return -1;