public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Maximiliano Sandoval <m.sandoval@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH qemu-server v5 6/9] block job: log when a fsfreeze could not happen
Date: Mon,  5 Jan 2026 13:16:49 +0100	[thread overview]
Message-ID: <20260105121702.20884-7-m.sandoval@proxmox.com> (raw)
In-Reply-To: <20260105121702.20884-1-m.sandoval@proxmox.com>

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@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



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


  parent reply	other threads:[~2026-01-05 12:17 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-05 12:16 [pve-devel] [PATCH docs/guest-common/qemu-server v5 00/11] fix #1964: add setting to always disable freezing a guest's fs Maximiliano Sandoval
2026-01-05 12:16 ` [pve-devel] [PATCH qemu-server v5 1/9] add a guest-fsfreeze qga setting Maximiliano Sandoval
2026-01-05 12:16 ` [pve-devel] [PATCH qemu-server v5 2/9] api: clone_vm: follow guest-fsfreeze setting Maximiliano Sandoval
2026-01-05 12:16 ` [pve-devel] [PATCH qemu-server v5 3/9] fix #1964: follow guest-fsfreeze setting on check freeze needed Maximiliano Sandoval
2026-01-05 12:16 ` [pve-devel] [PATCH qemu-server v5 4/9] agent: add a guest_fsthaw helper Maximiliano Sandoval
2026-01-05 12:16 ` [pve-devel] [PATCH qemu-server v5 5/9] port users of guest-fsfreeze-thaw users to helper Maximiliano Sandoval
2026-01-05 12:16 ` Maximiliano Sandoval [this message]
2026-01-05 12:16 ` [pve-devel] [PATCH qemu-server v5 7/9] block job: mirror: reword fsfreeze log entry Maximiliano Sandoval
2026-01-05 12:16 ` [pve-devel] [PATCH qemu-server v5 8/9] deprecate freeze-fs-on-backup qga setting Maximiliano Sandoval
2026-01-05 12:16 ` [pve-devel] [PATCH qemu-server v5 9/9] api: import: follow guest-fsfreeze setting Maximiliano Sandoval
2026-01-05 12:16 ` [pve-devel] [PATCH guest-common v5 1/1] abstract config: print when {, un}freezing a fs Maximiliano Sandoval
2026-01-05 12:16 ` [pve-devel] [PATCH docs v5 1/1] qm: document that import-from can issue a fsfreeze Maximiliano Sandoval
2026-02-24 14:54 ` applied-series: [pve-devel] [PATCH docs/guest-common/qemu-server v5 00/11] fix #1964: add setting to always disable freezing a guest's fs Fiona Ebner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260105121702.20884-7-m.sandoval@proxmox.com \
    --to=m.sandoval@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal