qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: leirao <lei.rao@intel.com>
To: chen.zhang@intel.com, lizhijian@cn.fujitsu.com,
	jasowang@redhat.com, quintela@redhat.com, dgilbert@redhat.com,
	pbonzini@redhat.com
Cc: leirao <lei.rao@intel.com>, qemu-devel@nongnu.org
Subject: [PATCH v2 3/3] Fix the qemu crash when guest shutdown in COLO mode
Date: Tue, 22 Sep 2020 05:24:50 -0400	[thread overview]
Message-ID: <1600766690-94980-4-git-send-email-lei.rao@intel.com> (raw)
In-Reply-To: <1600766690-94980-1-git-send-email-lei.rao@intel.com>

In COLO mode, if the startup parameters of QEMU include "no-shutdown",
QEMU will crash when the guest shutdown. The root cause is when the
guest shutdown, the state of VM will switch COLO to SHUTDOWN. When do
checkpoint again, the state will be changed to COLO. But the state
switch is undefined in runstate_transitions_def, we should add it.
This patch fixes the following:
qemu-system-x86_64: invalid runstate transition: 'shutdown' -> 'colo'
Aborted

Signed-off-by: leirao <lei.rao@intel.com>
---
 softmmu/vl.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/softmmu/vl.c b/softmmu/vl.c
index f7b1034..c21606c 100644
--- a/softmmu/vl.c
+++ b/softmmu/vl.c
@@ -631,6 +631,7 @@ static const RunStateTransition runstate_transitions_def[] = {
     { RUN_STATE_SHUTDOWN, RUN_STATE_PAUSED },
     { RUN_STATE_SHUTDOWN, RUN_STATE_FINISH_MIGRATE },
     { RUN_STATE_SHUTDOWN, RUN_STATE_PRELAUNCH },
+    { RUN_STATE_SHUTDOWN, RUN_STATE_COLO },
 
     { RUN_STATE_DEBUG, RUN_STATE_SUSPENDED },
     { RUN_STATE_RUNNING, RUN_STATE_SUSPENDED },
-- 
1.8.3.1



  parent reply	other threads:[~2020-09-22  9:46 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-22  9:24 [PATCH v2 0/3] Optimized some code for COLO leirao
2020-09-22  9:24 ` [PATCH v2 1/3] Optimize seq_sorter function for colo-compare leirao
2020-09-23  1:20   ` Zhang, Chen
2020-09-22  9:24 ` [PATCH v2 2/3] Reduce the time of checkpoint for COLO leirao
2020-09-23  1:25   ` Zhang, Chen
2020-09-23  3:59   ` Li Zhijian
2020-09-22  9:24 ` leirao [this message]
2020-09-23  1:27   ` [PATCH v2 3/3] Fix the qemu crash when guest shutdown in COLO mode Zhang, Chen

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=1600766690-94980-4-git-send-email-lei.rao@intel.com \
    --to=lei.rao@intel.com \
    --cc=chen.zhang@intel.com \
    --cc=dgilbert@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=lizhijian@cn.fujitsu.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.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;
as well as URLs for NNTP newsgroup(s).