All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] runstate: do not force prelaunch on reset during save-vm
@ 2026-09-16 10:12 Erik Fastermann
  2026-10-01  8:07 ` Erik Fastermann
  2026-10-13 11:23 ` Erik Fastermann
  0 siblings, 2 replies; 3+ messages in thread
From: Erik Fastermann @ 2026-09-16 10:12 UTC (permalink / raw)
  To: qemu-devel; +Cc: Paolo Bonzini, qemu-stable, Erik Fastermann

A reset processed while the VM sits in 'save-vm' aborts QEMU:

    invalid runstate transition: 'save-vm' -> 'prelaunch'

The window is reachable over QMP. dump-guest-memory with detach=true
stops the VM with vm_stop(RUN_STATE_SAVE_VM) in dump_init() and then
returns once dump_thread has been spawned, so the main loop keeps
running with the VM in 'save-vm' for the whole duration of the dump.
A system_reset in that window kills the guest, as
main_loop_should_exit() forces the run state to 'prelaunch'.

'save-vm' needs the same treatment as 'finish-migrate' in commit
1bd71dce4b ("runstate: ignore exit request in finish migrate state").
The reset cannot be applied to a run state whose only exits are back to
'running' or 'suspended', so leave it alone: dump_cleanup() ends it
with vm_start() once the dump thread is done.

Signed-off-by: Erik Fastermann <e.fastermann@proxmox.com>
---
 system/runstate.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/system/runstate.c b/system/runstate.c
index d3e64d2b62..1d65a4d444 100644
--- a/system/runstate.c
+++ b/system/runstate.c
@@ -1075,7 +1075,8 @@ static bool main_loop_should_exit(int *status)
          */
         if (!runstate_check(RUN_STATE_RUNNING) &&
                 !runstate_check(RUN_STATE_INMIGRATE) &&
-                !runstate_check(RUN_STATE_FINISH_MIGRATE)) {
+                !runstate_check(RUN_STATE_FINISH_MIGRATE) &&
+                !runstate_check(RUN_STATE_SAVE_VM)) {
             runstate_set(RUN_STATE_PRELAUNCH);
         }
     }
-- 
2.47.3



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] runstate: do not force prelaunch on reset during save-vm
  2026-09-16 10:12 [PATCH] runstate: do not force prelaunch on reset during save-vm Erik Fastermann
@ 2026-10-01  8:07 ` Erik Fastermann
  2026-10-13 11:23 ` Erik Fastermann
  1 sibling, 0 replies; 3+ messages in thread
From: Erik Fastermann @ 2026-10-01  8:07 UTC (permalink / raw)
  To: qemu-devel; +Cc: Paolo Bonzini, qemu-stable, Erik Fastermann

ping

https://patchew.org/QEMU/20260916101215.98436-1-e.fastermann@proxmox.com/




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] runstate: do not force prelaunch on reset during save-vm
  2026-09-16 10:12 [PATCH] runstate: do not force prelaunch on reset during save-vm Erik Fastermann
  2026-10-01  8:07 ` Erik Fastermann
@ 2026-10-13 11:23 ` Erik Fastermann
  1 sibling, 0 replies; 3+ messages in thread
From: Erik Fastermann @ 2026-10-13 11:23 UTC (permalink / raw)
  To: qemu-devel; +Cc: Paolo Bonzini, qemu-stable, Erik Fastermann

ping

https://patchew.org/QEMU/20260916101215.98436-1-e.fastermann@proxmox.com/




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-10-13 11:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-16 10:12 [PATCH] runstate: do not force prelaunch on reset during save-vm Erik Fastermann
2026-10-01  8:07 ` Erik Fastermann
2026-10-13 11:23 ` Erik Fastermann

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.