From: Christian Borntraeger Date: Tue, 18 Oct 2016 07:29:54 +0000 (+0200) Subject: vl: exit qemu on guest panic if -no-shutdown is not set X-Git-Tag: Tizen_Studio_1.3_Release_p2.3.2~10^2~14^2~5^2~79^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=864111f422babcf8ce837fb47f7f9e1948446f22;p=sdk%2Femulator%2Fqemu.git 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: Christian Borntraeger Message-Id: <1476775794-108012-1-git-send-email-borntraeger@de.ibm.com> Reviewed-by: Eric Blake Signed-off-by: Paolo Bonzini --- diff --git a/qapi-schema.json b/qapi-schema.json index 5dc96af469..b0b4bf64cc 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -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 diff --git a/vl.c b/vl.c index 368510fd8c..319f6413f2 100644 --- a/vl.c +++ b/vl.c @@ -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)