* [PATCH qemu] loadstate: exit QEMU if loading the saved VM state fails
@ 2026-11-23 0:51 Thomas Lamprecht
2026-11-23 14:07 ` applied: " Fiona Ebner
0 siblings, 1 reply; 2+ messages in thread
From: Thomas Lamprecht @ 2026-11-23 0:51 UTC (permalink / raw)
To: pve-devel
QEMU kept running without executing the guest if it could not load the
state given with -loadstate, and its startup reported success. For
management software, this looks the same as a successful load together
with -S, which also stays in the prelaunch state. qemu-server took such
a resume for a success and deleted the hibernation state, so a state
that could not be loaded only for now, for example after a change to the
VM config, got lost. After a rollback to a snapshot with RAM, it
continued such a VM, which then booted from firmware on the rolled back
disks and the rollback reported success.
Exit with an error, like for a failing -loadvm. Unless --preconfig is
used, the load happens before daemonizing, so with -daemonize the parent
process reports the failure through its exit code. No process is left
behind and the state stays untouched. The user can fix the cause and
retry or explicitly discard the state. FWIW, with protection enabled
on the VM, discarding needs root, as the lock of a hibernated VM
prevents others from disabling protection. More granular protection
and unlock could help to improve that, but nothing that QEMU has to
care about.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
---
...15-PVE-add-savevm-async-for-background-state-snapshots.patch | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/debian/patches/pve/0015-PVE-add-savevm-async-for-background-state-snapshots.patch b/debian/patches/pve/0015-PVE-add-savevm-async-for-background-state-snapshots.patch
index c7b141bfcb..b98a5d0ed9 100644
--- a/debian/patches/pve/0015-PVE-add-savevm-async-for-background-state-snapshots.patch
+++ b/debian/patches/pve/0015-PVE-add-savevm-async-for-background-state-snapshots.patch
@@ -978,7 +978,7 @@ index 061cbdf860..45c01fa53d 100644
+ Error *local_err = NULL;
+ if (load_snapshot_from_blockdev(loadstate, &local_err) < 0) {
+ error_report_err(local_err);
-+ autostart = 0;
++ exit(1);
+ }
}
if (replay_mode != REPLAY_MODE_NONE) {
--
2.47.3
^ permalink raw reply related [flat|nested] 2+ messages in thread* applied: [PATCH qemu] loadstate: exit QEMU if loading the saved VM state fails
2026-11-23 0:51 [PATCH qemu] loadstate: exit QEMU if loading the saved VM state fails Thomas Lamprecht
@ 2026-11-23 14:07 ` Fiona Ebner
0 siblings, 0 replies; 2+ messages in thread
From: Fiona Ebner @ 2026-11-23 14:07 UTC (permalink / raw)
To: pve-devel, Thomas Lamprecht
On Mon, 23 Nov 2026 01:51:54 +0100, Thomas Lamprecht wrote:
> QEMU kept running without executing the guest if it could not load the
> state given with -loadstate, and its startup reported success. For
> management software, this looks the same as a successful load together
> with -S, which also stays in the prelaunch state. qemu-server took such
> a resume for a success and deleted the hibernation state, so a state
> that could not be loaded only for now, for example after a change to the
> VM config, got lost. After a rollback to a snapshot with RAM, it
> continued such a VM, which then booted from firmware on the rolled back
> disks and the rollback reported success.
>
> [...]
Applied, thanks!
[1/1] loadstate: exit QEMU if loading the saved VM state fails
commit: 66e606a7b528fb6664fe4797e4262dcf9fc05726
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-11-23 14:07 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-23 0:51 [PATCH qemu] loadstate: exit QEMU if loading the saved VM state fails Thomas Lamprecht
2026-11-23 14:07 ` 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