* [PATCH qemu-server] fix #7697: snapshot hook name mismatch
@ 2026-06-12 10:07 Jakob Klocker
2026-06-18 12:40 ` Arthur Bied-Charreton
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Jakob Klocker @ 2026-06-12 10:07 UTC (permalink / raw)
To: pve-devel; +Cc: Jakob Klocker
pve-guest-common invokes the snapshot hook with the name
"after-unfreeze" [0], but qemu-server checks for "after-freeze" [1].
As a result, the post-unfreeze hook is never executed and the
query-savevm polling loop intended to wait for savevm-end cleanup
is skipped.
[0] https://git.proxmox.com/?p=pve-guest-common.git;a=blob;f=src/PVE/AbstractConfig.pm;h=7bcae1943094f99e98a8ba19428e1f90d4936080;hb=572ed3533d5ba75e82a5a0e367e2db1aff290c09#l868
[1] https://git.proxmox.com/?p=qemu-server.git;a=blob;f=src/PVE/QemuConfig.pm;h=80a3999e85886b603bdb1b5a8d3d2b3887dff369;hb=bef9334af96eb30cab8d1f5c41c0974eaf0bbdc4#l374
Link: https://bugzilla.proxmox.com/show_bug.cgi?id=7697
Signed-off-by: Jakob Klocker <j.klocker@proxmox.com>
---
src/PVE/QemuConfig.pm | 2 +-
src/test/snapshot-test.pm | 3 ++-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/PVE/QemuConfig.pm b/src/PVE/QemuConfig.pm
index 80a3999e..c24eb835 100644
--- a/src/PVE/QemuConfig.pm
+++ b/src/PVE/QemuConfig.pm
@@ -371,7 +371,7 @@ sub __snapshot_create_vol_snapshots_hook {
if $snap->{vmstate};
};
warn $@ if $@;
- } elsif ($hook eq "after-freeze") {
+ } elsif ($hook eq "after-unfreeze") {
# savevm-end is async, we need to wait
for (;;) {
my $stat = mon_cmd($vmid, "query-savevm");
diff --git a/src/test/snapshot-test.pm b/src/test/snapshot-test.pm
index e28107b9..3e3b9412 100644
--- a/src/test/snapshot-test.pm
+++ b/src/test/snapshot-test.pm
@@ -379,12 +379,13 @@ sub qmp_cmd {
if ($exec eq "savevm-end") {
die "savevm-end disabled\n"
if !$vm_mon->{savevm_end};
+ $vm_mon->{savevm_ended} = 1;
return;
}
if ($exec eq "query-savevm") {
return {
"status" => "completed",
- "bytes" => 1024 * 1024 * 1024,
+ "bytes" => $vm_mon->{savevm_ended} ? 0 : 1024 * 1024 * 1024,
"total-time" => 5000,
};
}
--
2.47.3
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH qemu-server] fix #7697: snapshot hook name mismatch
2026-06-12 10:07 [PATCH qemu-server] fix #7697: snapshot hook name mismatch Jakob Klocker
@ 2026-06-18 12:40 ` Arthur Bied-Charreton
2026-06-23 14:16 ` Michael Köppl
2026-06-24 10:35 ` applied: " Fiona Ebner
2 siblings, 0 replies; 4+ messages in thread
From: Arthur Bied-Charreton @ 2026-06-18 12:40 UTC (permalink / raw)
To: Jakob Klocker; +Cc: pve-devel
On Fri, Jun 12, 2026 at 12:07:58PM +0200, Jakob Klocker wrote:
> pve-guest-common invokes the snapshot hook with the name
> "after-unfreeze" [0], but qemu-server checks for "after-freeze" [1].
>
> As a result, the post-unfreeze hook is never executed and the
> query-savevm polling loop intended to wait for savevm-end cleanup
> is skipped.
>
> [0] https://git.proxmox.com/?p=pve-guest-common.git;a=blob;f=src/PVE/AbstractConfig.pm;h=7bcae1943094f99e98a8ba19428e1f90d4936080;hb=572ed3533d5ba75e82a5a0e367e2db1aff290c09#l868
> [1] https://git.proxmox.com/?p=qemu-server.git;a=blob;f=src/PVE/QemuConfig.pm;h=80a3999e85886b603bdb1b5a8d3d2b3887dff369;hb=bef9334af96eb30cab8d1f5c41c0974eaf0bbdc4#l374
>
> Link: https://bugzilla.proxmox.com/show_bug.cgi?id=7697
> Signed-off-by: Jakob Klocker <j.klocker@proxmox.com>
> ---
> src/PVE/QemuConfig.pm | 2 +-
> src/test/snapshot-test.pm | 3 ++-
> 2 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/src/PVE/QemuConfig.pm b/src/PVE/QemuConfig.pm
> index 80a3999e..c24eb835 100644
> --- a/src/PVE/QemuConfig.pm
> +++ b/src/PVE/QemuConfig.pm
> @@ -371,7 +371,7 @@ sub __snapshot_create_vol_snapshots_hook {
> if $snap->{vmstate};
> };
> warn $@ if $@;
> - } elsif ($hook eq "after-freeze") {
> + } elsif ($hook eq "after-unfreeze") {
> # savevm-end is async, we need to wait
> for (;;) {
> my $stat = mon_cmd($vmid, "query-savevm");
> diff --git a/src/test/snapshot-test.pm b/src/test/snapshot-test.pm
> index e28107b9..3e3b9412 100644
> --- a/src/test/snapshot-test.pm
> +++ b/src/test/snapshot-test.pm
> @@ -379,12 +379,13 @@ sub qmp_cmd {
> if ($exec eq "savevm-end") {
> die "savevm-end disabled\n"
> if !$vm_mon->{savevm_end};
> + $vm_mon->{savevm_ended} = 1;
> return;
> }
> if ($exec eq "query-savevm") {
> return {
> "status" => "completed",
> - "bytes" => 1024 * 1024 * 1024,
> + "bytes" => $vm_mon->{savevm_ended} ? 0 : 1024 * 1024 * 1024,
> "total-time" => 5000,
> };
> }
> --
> 2.47.3
>
I tested the series fixing #5032 [0], which depends on this, and
the after-unfreeze hook is indeed executed. Consider this:
Tested-by: Arthur Bied-Charreton <a.bied-charreton@proxmox.com>
[0] https://lore.proxmox.com/all/20260612122942.181958-1-j.klocker@proxmox.com/T/#u
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH qemu-server] fix #7697: snapshot hook name mismatch
2026-06-12 10:07 [PATCH qemu-server] fix #7697: snapshot hook name mismatch Jakob Klocker
2026-06-18 12:40 ` Arthur Bied-Charreton
@ 2026-06-23 14:16 ` Michael Köppl
2026-06-24 10:35 ` applied: " Fiona Ebner
2 siblings, 0 replies; 4+ messages in thread
From: Michael Köppl @ 2026-06-23 14:16 UTC (permalink / raw)
To: Jakob Klocker, pve-devel
Tested this in combination with the fix for #5032 [0]. With this patch
applied, the hook is called as expected.
The changes look simple enough. Had a look at how the hook is called
when a snapshot is made and it seems correct to me that this should be
after-unfreeze.
Consider this:
Tested-by: Michael Köppl <m.koeppl@proxmox.com>
Reviewed-by: Michael Köppl <m.koeppl@proxmox.com>
[0] https://lore.proxmox.com/pve-devel/20260622134711.108611-1-j.klocker@proxmox.com/
On Fri Jun 12, 2026 at 12:07 PM CEST, Jakob Klocker wrote:
> pve-guest-common invokes the snapshot hook with the name
> "after-unfreeze" [0], but qemu-server checks for "after-freeze" [1].
[snip]
^ permalink raw reply [flat|nested] 4+ messages in thread
* applied: [PATCH qemu-server] fix #7697: snapshot hook name mismatch
2026-06-12 10:07 [PATCH qemu-server] fix #7697: snapshot hook name mismatch Jakob Klocker
2026-06-18 12:40 ` Arthur Bied-Charreton
2026-06-23 14:16 ` Michael Köppl
@ 2026-06-24 10:35 ` Fiona Ebner
2 siblings, 0 replies; 4+ messages in thread
From: Fiona Ebner @ 2026-06-24 10:35 UTC (permalink / raw)
To: pve-devel, Jakob Klocker
On Fri, 12 Jun 2026 12:07:58 +0200, Jakob Klocker wrote:
> pve-guest-common invokes the snapshot hook with the name
> "after-unfreeze" [0], but qemu-server checks for "after-freeze" [1].
>
> As a result, the post-unfreeze hook is never executed and the
> query-savevm polling loop intended to wait for savevm-end cleanup
> is skipped.
Applied, thanks! I modeled the test more closely after the actual
behavior, returning an empty JSON object after the savevm operation
has ended. This also required unsetting the savevm_ended property in
the test upon savevm-start. In a follow-up, I updated the existing
message in the loop to hopefully be a bit clearer to end-users.
[1/1] fix #7697: snapshot hook name mismatch
commit: 568b295c7b425e16b8fd3f5b7fe1cfe7bcce94d9
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-06-24 10:36 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-12 10:07 [PATCH qemu-server] fix #7697: snapshot hook name mismatch Jakob Klocker
2026-06-18 12:40 ` Arthur Bied-Charreton
2026-06-23 14:16 ` Michael Köppl
2026-06-24 10:35 ` applied: " Fiona Ebner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox