all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Fiona Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [PATCH qemu-server 1/3] fix #8331: snapshot: fix regression with endless loop after error
Date: Wed, 18 Nov 2026 13:21:47 +0100	[thread overview]
Message-ID: <20261118122359.123647-2-f.ebner@proxmox.com> (raw)
In-Reply-To: <20261118122359.123647-1-f.ebner@proxmox.com>

The loop in the 'after-unfreeze' hook phase relies on the 'bytes'
value from the result of 'query-savevm' disappearing when the
'savevm-end' command is done. This does not happen in case of an
error status currently. Use a timeout of 35 seconds instead to ensure
that the loop stays bounded.

A further improvement requires QEMU to report more information with
'query-savevm'.

Fixes: 568b295c ("fix #7697: snapshot hook name mismatch")
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
 src/PVE/QemuConfig.pm | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/PVE/QemuConfig.pm b/src/PVE/QemuConfig.pm
index d89a62e6..f35a49eb 100644
--- a/src/PVE/QemuConfig.pm
+++ b/src/PVE/QemuConfig.pm
@@ -390,11 +390,16 @@ sub __snapshot_create_vol_snapshots_hook {
             };
             warn $@ if $@;
         } elsif ($hook eq "after-unfreeze") {
-            # savevm-end is async, we need to wait
+            # savevm-end is async and waits for up to 30 seconds for closing the target.
+            my $timeout = 35;
+            my $start_time = time();
             for (;;) {
                 my $stat = mon_cmd($vmid, "query-savevm");
                 if (!$stat->{bytes}) {
                     last;
+                } elsif ((time() - $start_time) >= $timeout) {
+                    warn "timeout waiting for 'savevm-end' to complete\n";
+                    last;
                 } else {
                     print "waiting for QEMU to finish the 'savevm-end' command...\n";
                     sleep(1);
-- 
2.47.3





  reply	other threads:[~2026-11-18 12:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-18 12:21 [PATCH-SERIES qemu-server/qemu 0/3] fix #8331: snapshot: fix regression with endless loop after error Fiona Ebner
2026-11-18 12:21 ` Fiona Ebner [this message]
2026-11-18 12:21 ` [PATCH qemu-server 2/3] snapshot: directly check for savevm-end status Fiona Ebner
2026-11-18 12:21 ` [PATCH qemu 3/3] async snapshot: keep track of " Fiona Ebner
2026-11-18 21:02 ` applied: [PATCH-SERIES qemu-server/qemu 0/3] fix #8331: snapshot: fix regression with endless loop after error Thomas Lamprecht

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=20261118122359.123647-2-f.ebner@proxmox.com \
    --to=f.ebner@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal