public inbox for pve-devel@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 2/3] snapshot: directly check for savevm-end status
Date: Wed, 18 Nov 2026 13:21:48 +0100	[thread overview]
Message-ID: <20261118122359.123647-3-f.ebner@proxmox.com> (raw)
In-Reply-To: <20261118122359.123647-1-f.ebner@proxmox.com>

Since pve-qemu >= 11.1.3-3, 'query-savevm' reports if there is an
active 'savevm-end' handler. Check this status directly, while keeping
the proxy check for the presence of 'bytes' for compatibility with
older QEMU binaries. Checking for 'bytes' did not work as a sentinel
in case the snapshot ended with an error status, as the field was
always present.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---

NOTE: the version in the commit message needs to be adapted depending
on the pve-qemu-kvm version for which patch 3/3 is applied.

 src/PVE/QemuConfig.pm | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/src/PVE/QemuConfig.pm b/src/PVE/QemuConfig.pm
index f35a49eb..a8279ac6 100644
--- a/src/PVE/QemuConfig.pm
+++ b/src/PVE/QemuConfig.pm
@@ -395,9 +395,14 @@ sub __snapshot_create_vol_snapshots_hook {
             my $start_time = time();
             for (;;) {
                 my $stat = mon_cmd($vmid, "query-savevm");
-                if (!$stat->{bytes}) {
-                    last;
-                } elsif ((time() - $start_time) >= $timeout) {
+
+                if (defined($stat->{'savevm-end-active'})) {
+                    last if !$stat->{'savevm-end-active'};
+                } else { # Fallback for older QEMU binaries that did not report savevm-end-active
+                    last if !$stat->{bytes};
+                }
+
+                if ((time() - $start_time) >= $timeout) {
                     warn "timeout waiting for 'savevm-end' to complete\n";
                     last;
                 } else {
-- 
2.47.3





  parent 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 ` [PATCH qemu-server 1/3] " Fiona Ebner
2026-11-18 12:21 ` Fiona Ebner [this message]
2026-11-18 12:21 ` [PATCH qemu 3/3] async snapshot: keep track of savevm-end status 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-3-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 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