From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41617) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c1bxM-0002BE-Bz for qemu-devel@nongnu.org; Tue, 01 Nov 2016 12:30:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c1bxL-0006sb-4Z for qemu-devel@nongnu.org; Tue, 01 Nov 2016 12:30:36 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51652) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1c1bxK-0006sU-VR for qemu-devel@nongnu.org; Tue, 01 Nov 2016 12:30:35 -0400 From: Paolo Bonzini Date: Tue, 1 Nov 2016 17:29:41 +0100 Message-Id: <1478017783-7703-29-git-send-email-pbonzini@redhat.com> In-Reply-To: <1478017783-7703-1-git-send-email-pbonzini@redhat.com> References: <1478017783-7703-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PULL 28/30] vl: exit qemu on guest panic if -no-shutdown is not set List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Christian Borntraeger From: Christian Borntraeger 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 --- qapi-schema.json | 4 ++-- vl.c | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/qapi-schema.json b/qapi-schema.json index 5dc96af..b0b4bf6 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 368510f..319f641 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) -- 2.7.4