aboutsummaryrefslogtreecommitdiff
path: root/vl.c
diff options
context:
space:
mode:
authorHu Tao <hutao@cn.fujitsu.com>2013-04-26 11:24:40 +0800
committerAnthony Liguori <aliguori@us.ibm.com>2013-04-30 10:30:00 -0500
commitede085b3fedfde36cb566968c4efcfbad4845af1 (patch)
treeb90f863b0085d4d8177f71217aaf83031ecd1fc4 /vl.c
parentcffc5113a421feba767af57ec87fdd53a29e9f9c (diff)
add a new runstate: RUN_STATE_GUEST_PANICKED
The guest will be in this state when it is panicked. Signed-off-by: Wen Congyang <wency@cn.fujitsu.com> Signed-off-by: Hu Tao <hutao@cn.fujitsu.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Message-id: 0255f263ffdc2a3716f73e89098b96fd79a235b3.1366945969.git.hutao@cn.fujitsu.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'vl.c')
-rw-r--r--vl.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/vl.c b/vl.c
index 617ff2ca0a..b5a547e7e5 100644
--- a/vl.c
+++ b/vl.c
@@ -594,6 +594,7 @@ static const RunStateTransition runstate_transitions_def[] = {
{ RUN_STATE_RUNNING, RUN_STATE_SAVE_VM },
{ RUN_STATE_RUNNING, RUN_STATE_SHUTDOWN },
{ RUN_STATE_RUNNING, RUN_STATE_WATCHDOG },
+ { RUN_STATE_RUNNING, RUN_STATE_GUEST_PANICKED },
{ RUN_STATE_SAVE_VM, RUN_STATE_RUNNING },
@@ -608,6 +609,8 @@ static const RunStateTransition runstate_transitions_def[] = {
{ RUN_STATE_WATCHDOG, RUN_STATE_RUNNING },
{ RUN_STATE_WATCHDOG, RUN_STATE_FINISH_MIGRATE },
+ { RUN_STATE_GUEST_PANICKED, RUN_STATE_PAUSED },
+
{ RUN_STATE_MAX, RUN_STATE_MAX },
};
@@ -649,6 +652,13 @@ int runstate_is_running(void)
return runstate_check(RUN_STATE_RUNNING);
}
+bool runstate_needs_reset(void)
+{
+ return runstate_check(RUN_STATE_INTERNAL_ERROR) ||
+ runstate_check(RUN_STATE_SHUTDOWN) ||
+ runstate_check(RUN_STATE_GUEST_PANICKED);
+}
+
StatusInfo *qmp_query_status(Error **errp)
{
StatusInfo *info = g_malloc0(sizeof(*info));
@@ -1984,8 +1994,7 @@ static bool main_loop_should_exit(void)
cpu_synchronize_all_states();
qemu_system_reset(VMRESET_REPORT);
resume_all_vcpus();
- if (runstate_check(RUN_STATE_INTERNAL_ERROR) ||
- runstate_check(RUN_STATE_SHUTDOWN)) {
+ if (runstate_needs_reset()) {
runstate_set(RUN_STATE_PAUSED);
}
}