]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: domain: Base block job interlocking on QEMU_CAPS_INCREMENTAL_BACKUP
authorPeter Krempa <pkrempa@redhat.com>
Thu, 26 Sep 2019 12:08:11 +0000 (14:08 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 30 Sep 2019 11:12:56 +0000 (13:12 +0200)
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 <pkrempa@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
src/qemu/qemu_checkpoint.c
src/qemu/qemu_domain.c

index ac6328afa9aef60ec7d18ca1900c2c5a29f0dd68..7b305d035aeb95a65f2dd0b886eba4a8fdb263b0 100644 (file)
@@ -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"));
index c9c1bb4276c06b2a9c1fa56f0c9b32b8b498f9fb..24c8896ceb0cecb0ce70c9c492f858f9a3f243cf 100644 (file)
@@ -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;