summaryrefslogtreecommitdiff
path: root/vl.c
diff options
context:
space:
mode:
authorChristian Borntraeger <borntraeger@de.ibm.com>2016-10-18 09:29:54 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2016-11-02 09:28:56 +0100
commit864111f422babcf8ce837fb47f7f9e1948446f22 (patch)
tree954c396ba91f3ea990ebc0c96ad0f9a2a5d418f1 /vl.c
parent000980cb8307afe0578368cee8f31018905bb036 (diff)
downloadqemu-864111f422babcf8ce837fb47f7f9e1948446f22.tar.gz
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 <borntraeger@de.ibm.com> Message-Id: <1476775794-108012-1-git-send-email-borntraeger@de.ibm.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'vl.c')
-rw-r--r--vl.c5
1 files changed, 5 insertions, 0 deletions
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)