]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemuSnapshotPrepare: Prohibit 'manual' disk snapshot mode with VIR_DOMAIN_SNAPSHOT_CR...
authorPeter Krempa <pkrempa@redhat.com>
Mon, 1 Dec 2025 15:50:09 +0000 (16:50 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Wed, 10 Dec 2025 10:07:34 +0000 (11:07 +0100)
If the snapshot has a disk using 'manual' snapshot mode we keep the VM
paused until the user resumes it (presumably after they've done steps to
take the disk snapshot).

Since quiescing is done via the guest agent this means it will not be
possible while the VM is paused.

Rather than trying to implement complex recovery from this state prevent
the use of VIR_DOMAIN_SNAPSHOT_CREATE_QUIESCE for the snapshot. The user
still can call virDomainFSFreeze/virDomainFSThaw manually.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/qemu/qemu_snapshot.c

index bf25c70826ed50ac2c6b046743e1f434342d1155..5b0b52e2ba07e241b9acc0847d292a6ec96c37c6 100644 (file)
@@ -1075,6 +1075,12 @@ qemuSnapshotPrepare(virDomainObj *vm,
         }
     }
 
+    if (*has_manual && (*flags & VIR_DOMAIN_SNAPSHOT_CREATE_QUIESCE)) {
+            virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
+                           _("'manual' disk snapshot mode requires explicit quiescing (VIR_DOMAIN_SNAPSHOT_CREATE_QUIESCE is not supported)"));
+            return -1;
+    }
+
     /* Alter flags to let later users know what we learned.  */
     if (external && !active)
         *flags |= VIR_DOMAIN_SNAPSHOT_CREATE_DISK_ONLY;