17.6.1.3.1. Exit QEMU on panic
Enabled by default with:
-
panic=-1
command line option which reboots the kernel immediately on panic, see: Section 17.6.1.4, “Reboot on panic” -
QEMU
-no-reboot
, which makes QEMU exit when the guest tries to reboot
Also asked at https://unix.stackexchange.com/questions/443017/can-i-make-qemu-exit-with-failure-on-kernel-panic which also mentions the x86_64 -device pvpanic
, but I don’t see much advantage to it.
TODO neither method exits with exit status different from 0, so for now we are just grepping the logs for panic messages, which sucks.
One possibility that gets close would be to use GDB step debug to break at the panic
function, and then send a QEMU monitor from GDB quit
command if that happens, but I don’t see a way to exit with non-zero status to indicate error.