[pve-devel] [PATCH qemu-server v3 2/7] block job: mirror: follow guest-fsfreeze setting

Maximiliano Sandoval m.sandoval at proxmox.com
Tue Oct 14 14:27:09 CEST 2025


This is used when performing a full-clone of a running VM.

Signed-off-by: Maximiliano Sandoval <m.sandoval at proxmox.com>
---
 src/PVE/QemuServer/BlockJob.pm | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/PVE/QemuServer/BlockJob.pm b/src/PVE/QemuServer/BlockJob.pm
index 506010e1..5a4b416e 100644
--- a/src/PVE/QemuServer/BlockJob.pm
+++ b/src/PVE/QemuServer/BlockJob.pm
@@ -162,8 +162,11 @@ sub qemu_drive_mirror_monitor {
                 last if $completion eq 'skip' || $completion eq 'auto';
 
                 if ($vmiddst && $vmiddst != $vmid) {
+                    my $config = PVE::QemuConfig->load_config($vmid);
+                    my $fsfreeze =
+                        PVE::QemuServer::Agent::get_qga_key($config, 'guest-fsfreeze') // 1;
                     my $agent_running = $qga && qga_check_running($vmid);
-                    if ($agent_running) {
+                    if ($agent_running && $fsfreeze) {
                         print "freeze filesystem\n";
                         eval { PVE::QemuServer::Agent::guest_fsfreeze($vmid); };
                         warn $@ if $@;
@@ -176,7 +179,7 @@ sub qemu_drive_mirror_monitor {
                     # if we clone a disk for a new target vm, we don't switch the disk
                     qemu_blockjobs_cancel($vmid, $jobs);
 
-                    if ($agent_running) {
+                    if ($agent_running && $fsfreeze) {
                         print "unfreeze filesystem\n";
                         eval { mon_cmd($vmid, "guest-fsfreeze-thaw"); };
                         warn $@ if $@;
-- 
2.47.3





More information about the pve-devel mailing list