Signed-off-by: Lei Li <li...@linux.vnet.ibm.com>
---
qapi-schema.json | 11 +++++++----
vl.c | 12 +++++++++++-
2 files changed, 18 insertions(+), 5 deletions(-)
diff --git a/qapi-schema.json b/qapi-schema.json
index 523a5b2..8178d0c 100644
--- a/qapi-schema.json
+++ b/qapi-schema.json
@@ -176,12 +176,15 @@
# @watchdog: the watchdog action is configured to pause and has been triggered
#
# @guest-panicked: guest has been panicked as a result of guest OS panic
+#
+# @flipping-migrate: guest is paused to start unix_page_flipping migration
+# process
##
{ 'enum': 'RunState',
- 'data': [ 'debug', 'inmigrate', 'internal-error', 'io-error', 'paused',
- 'postmigrate', 'prelaunch', 'finish-migrate', 'restore-vm',
- 'running', 'save-vm', 'shutdown', 'suspended', 'watchdog',
- 'guest-panicked' ] }
+ 'data': [ 'debug', 'flipping-migrate', 'inmigrate', 'internal-error',
+ 'io-error', 'paused', 'postmigrate', 'prelaunch', 'finish-migrate',
+ 'restore-vm', 'running', 'save-vm', 'shutdown', 'suspended',
+ 'watchdog', 'guest-panicked' ] }
##
# @SnapshotInfo
diff --git a/vl.c b/vl.c
index b42ac67..fcdf981 100644
--- a/vl.c
+++ b/vl.c
@@ -601,6 +601,7 @@ static const RunStateTransition runstate_transitions_def[]
= {
{ RUN_STATE_PAUSED, RUN_STATE_RUNNING },
{ RUN_STATE_PAUSED, RUN_STATE_FINISH_MIGRATE },
+ { RUN_STATE_PAUSED, RUN_STATE_FLIPPING_MIGRATE },
{ RUN_STATE_POSTMIGRATE, RUN_STATE_RUNNING },
{ RUN_STATE_POSTMIGRATE, RUN_STATE_FINISH_MIGRATE },
@@ -624,23 +625,31 @@ static const RunStateTransition
runstate_transitions_def[] = {
{ RUN_STATE_RUNNING, RUN_STATE_SHUTDOWN },
{ RUN_STATE_RUNNING, RUN_STATE_WATCHDOG },
{ RUN_STATE_RUNNING, RUN_STATE_GUEST_PANICKED },
+ { RUN_STATE_RUNNING, RUN_STATE_FLIPPING_MIGRATE },
{ RUN_STATE_SAVE_VM, RUN_STATE_RUNNING },
{ RUN_STATE_SHUTDOWN, RUN_STATE_PAUSED },
{ RUN_STATE_SHUTDOWN, RUN_STATE_FINISH_MIGRATE },
+ { RUN_STATE_SHUTDOWN, RUN_STATE_FLIPPING_MIGRATE },
{ RUN_STATE_DEBUG, RUN_STATE_SUSPENDED },
{ RUN_STATE_RUNNING, RUN_STATE_SUSPENDED },
{ RUN_STATE_SUSPENDED, RUN_STATE_RUNNING },
{ RUN_STATE_SUSPENDED, RUN_STATE_FINISH_MIGRATE },
+ { RUN_STATE_SUSPENDED, RUN_STATE_FLIPPING_MIGRATE },
{ RUN_STATE_WATCHDOG, RUN_STATE_RUNNING },
{ RUN_STATE_WATCHDOG, RUN_STATE_FINISH_MIGRATE },
+ { RUN_STATE_WATCHDOG, RUN_STATE_FLIPPING_MIGRATE },
{ RUN_STATE_GUEST_PANICKED, RUN_STATE_PAUSED },
{ RUN_STATE_GUEST_PANICKED, RUN_STATE_FINISH_MIGRATE },
{ RUN_STATE_GUEST_PANICKED, RUN_STATE_DEBUG },
+ { RUN_STATE_GUEST_PANICKED, RUN_STATE_FLIPPING_MIGRATE },
+
+ { RUN_STATE_FLIPPING_MIGRATE, RUN_STATE_RUNNING },
+ { RUN_STATE_FLIPPING_MIGRATE, RUN_STATE_POSTMIGRATE },
{ RUN_STATE_MAX, RUN_STATE_MAX },
};
@@ -687,7 +696,8 @@ bool runstate_needs_reset(void)
{
return runstate_check(RUN_STATE_INTERNAL_ERROR) ||
runstate_check(RUN_STATE_SHUTDOWN) ||
- runstate_check(RUN_STATE_GUEST_PANICKED);
+ runstate_check(RUN_STATE_GUEST_PANICKED) ||
+ runstate_check(RUN_STATE_FLIPPING_MIGRATE);
}
StatusInfo *qmp_query_status(Error **errp)