From: Trieu Huynh <vikingtc4@gmail.com>
To: qemu-devel@nongnu.org
Cc: Trieu Huynh <vikingtc4@gmail.com>, Paolo Bonzini <pbonzini@redhat.com>
Subject: [PATCH] runstate: allow inmigrate -> debug transition on snapshot restore
Date: Fri, 3 Apr 2026 02:43:14 +0700 [thread overview]
Message-ID: <20260402194314.20104-1-viking4@gmail.com> (raw)
From: Trieu Huynh <vikingtc4@gmail.com>
When a VM snapshot is taken while the guest is paused by a gdbstub
(RUN_STATE_DEBUG), the saved runstate is 'debug', for instance:
(gdb) monitor info status
VM status: paused (debug)
On restore, the destination starts in 'inmigrate' and transitions
to the saved runstate, but the 'inmigrate -> debug' transition
was missing from the table, causing an abort:
$ ./qemu-system-x86_64 -machine pc,accel=kvm:tcg -m 128M
-display none -gdb tcp::1235 -incoming "exec:cat /tmp/snap.img"
> /tmp/qemu-restore.log 2>&1
Aborted (core dumped)
$ cat /tmp/qemu-restore.log
qemu-system-x86_64: invalid runstate transition: 'inmigrate'
-> 'debug'
Fix it by adding the missing one (Point out by the author
Dustin Spicuzza)
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1231
Signed-off-by: Trieu Huynh <vikingtc4@gmail.com>
---
system/runstate.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/system/runstate.c b/system/runstate.c
index 2d4e95a216..97a6a1c736 100644
--- a/system/runstate.c
+++ b/system/runstate.c
@@ -94,6 +94,7 @@ static const RunStateTransition runstate_transitions_def[] = {
{ RUN_STATE_INMIGRATE, RUN_STATE_PRELAUNCH },
{ RUN_STATE_INMIGRATE, RUN_STATE_POSTMIGRATE },
{ RUN_STATE_INMIGRATE, RUN_STATE_COLO },
+ { RUN_STATE_INMIGRATE, RUN_STATE_DEBUG },
{ RUN_STATE_INTERNAL_ERROR, RUN_STATE_PAUSED },
{ RUN_STATE_INTERNAL_ERROR, RUN_STATE_FINISH_MIGRATE },
--
2.43.0
next reply other threads:[~2026-04-02 19:44 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-02 19:43 Trieu Huynh [this message]
2026-04-06 13:48 ` [PATCH] runstate: allow inmigrate -> debug transition on snapshot restore Fabiano Rosas
2026-04-07 19:39 ` Trieu Huynh
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=20260402194314.20104-1-viking4@gmail.com \
--to=vikingtc4@gmail.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
/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.