提交 864111f4 编写于 作者: C Christian Borntraeger 提交者: Paolo Bonzini

vl: exit qemu on guest panic if -no-shutdown is not set

For automated testing purposes it can be helpful to exit qemu
(poweroff) when the guest panics. Make this the default unless
-no-shutdown is specified.

For internal-errors like errors from KVM_RUN the behaviour is
not changed, in other words QEMU does not exit to allow debugging
in the QEMU monitor.
Signed-off-by: NChristian Borntraeger <borntraeger@de.ibm.com>
Message-Id: <1476775794-108012-1-git-send-email-borntraeger@de.ibm.com>
Reviewed-by: NEric Blake <eblake@redhat.com>
Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
上级 000980cb
......@@ -4621,10 +4621,10 @@
#
# @pause: system pauses
#
# Since: 2.1
# Since: 2.1 (poweroff since 2.8)
##
{ 'enum': 'GuestPanicAction',
'data': [ 'pause' ] }
'data': [ 'pause', 'poweroff' ] }
##
# @rtc-reset-reinjection
......
......@@ -1792,6 +1792,11 @@ void qemu_system_guest_panicked(void)
}
qapi_event_send_guest_panicked(GUEST_PANIC_ACTION_PAUSE, &error_abort);
vm_stop(RUN_STATE_GUEST_PANICKED);
if (!no_shutdown) {
qapi_event_send_guest_panicked(GUEST_PANIC_ACTION_POWEROFF,
&error_abort);
qemu_system_shutdown_request();
}
}
void qemu_system_reset_request(void)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册