qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [RFC PATCH] vl: fix migration when watchdog expires
@ 2018-08-14 10:48 Jay Zhou
  2018-08-14 11:20 ` Paolo Bonzini
  0 siblings, 1 reply; 11+ messages in thread
From: Jay Zhou @ 2018-08-14 10:48 UTC (permalink / raw)
  To: pbonzini; +Cc: qemu-devel, dgilbert, quintela, wangxinxin.wang, jianjay.zhou

I got the following error when migrating a VM with watchdog
device:

{"timestamp": {"seconds": 1533884471, "microseconds": 668099},
"event": "WATCHDOG", "data": {"action": "reset"}}
{"timestamp": {"seconds": 1533884471, "microseconds": 677658},
"event": "RESET", "data": {"guest": true}}
{"timestamp": {"seconds": 1533884471, "microseconds": 677874},
"event": "STOP"}
qemu-system-x86_64: invalid runstate transition: 'prelaunch' -> 'postmigrate'
Aborted

The run state transition is RUN_STATE_FINISH_MIGRATE to RUN_STATE_PRELAUNCH,
then the migration thread aborted when it tries to set RUN_STATE_POSTMIGRATE.
There is a race between the main loop thread and the migration thread I think.

Signed-off-by: Jay Zhou <jianjay.zhou@huawei.com>
---
 vl.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/vl.c b/vl.c
index 16b913f..298ce91 100644
--- a/vl.c
+++ b/vl.c
@@ -637,6 +637,7 @@ static const RunStateTransition runstate_transitions_def[] = {
     { RUN_STATE_PRELAUNCH, RUN_STATE_RUNNING },
     { RUN_STATE_PRELAUNCH, RUN_STATE_FINISH_MIGRATE },
     { RUN_STATE_PRELAUNCH, RUN_STATE_INMIGRATE },
+    { RUN_STATE_PRELAUNCH, RUN_STATE_POSTMIGRATE },
 
     { RUN_STATE_FINISH_MIGRATE, RUN_STATE_RUNNING },
     { RUN_STATE_FINISH_MIGRATE, RUN_STATE_PAUSED },
-- 
1.8.3.1

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

end of thread, other threads:[~2018-08-17 16:13 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-14 10:48 [Qemu-devel] [RFC PATCH] vl: fix migration when watchdog expires Jay Zhou
2018-08-14 11:20 ` Paolo Bonzini
2018-08-14 11:52   ` Dr. David Alan Gilbert
2018-08-14 12:02     ` Paolo Bonzini
2018-08-14 13:03       ` Zhoujian (jay)
2018-08-14 13:07         ` Paolo Bonzini
2018-08-14 13:34           ` Zhoujian (jay)
2018-08-16  7:22           ` Zhoujian (jay)
2018-08-17 16:03             ` Paolo Bonzini
2018-08-17 16:09               ` Dr. David Alan Gilbert
2018-08-14 12:49     ` Zhoujian (jay)

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).