[pve-devel] [PATCH qemu-server v5 6/9] block job: log when a fsfreeze could not happen
Maximiliano Sandoval
m.sandoval at proxmox.com
Mon Jan 5 13:16:49 CET 2026
We print a message when the config says that we should issue a
guest-fsfreeze-freeze command but we can't because the agent is not
running or vise versa.
Signed-off-by: Maximiliano Sandoval <m.sandoval at proxmox.com>
---
src/PVE/QemuServer/BlockJob.pm | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/src/PVE/QemuServer/BlockJob.pm b/src/PVE/QemuServer/BlockJob.pm
index b25dcf9a..313918e3 100644
--- a/src/PVE/QemuServer/BlockJob.pm
+++ b/src/PVE/QemuServer/BlockJob.pm
@@ -162,11 +162,17 @@ sub qemu_drive_mirror_monitor {
last if $completion eq 'skip' || $completion eq 'auto';
if ($vmiddst && $vmiddst != $vmid) {
- my $agent_running = $qga && qga_check_running($vmid);
- if ($agent_running) {
+ my $agent_running = qga_check_running($vmid);
+ my $should_fsfreeze = $qga && $agent_running;
+ if ($should_fsfreeze) {
print "freeze filesystem\n";
eval { PVE::QemuServer::Agent::guest_fsfreeze($vmid); };
warn $@ if $@;
+ } elsif ($agent_running && !$qga) {
+ print "skipping guest-agent 'guest-fsfreeze-freeze', disabled in VM options\n";
+ } elsif (!$agent_running && $qga) {
+ print
+ "skipping guest agent 'guest-fsfreeze-freeze' command: the agent is not running inside of the guest\n";
} else {
print "suspend vm\n";
eval { PVE::QemuServer::RunState::vm_suspend($vmid, 1); };
@@ -176,7 +182,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 ($should_fsfreeze) {
print "unfreeze filesystem\n";
eval { PVE::QemuServer::Agent::guest_fsthaw($vmid); };
warn $@ if $@;
--
2.47.3
More information about the pve-devel
mailing list