On 17/10/2016 14:54, Christian Borntraeger wrote: > On 10/17/2016 02:50 PM, Paolo Bonzini wrote: >>> Some testcase will trigger a guest panic state. For testing purposes >>> it can be useful to exit QEMU anyway. >> >> I wonder if this should be done by default *unless* -no-shutdown is >> provided. This would require some planning (and delay this to 2.9, >> in all likelihood), but it probably would be pretty nice for general >> usage. > > Yes, might also an option. There are basically two cases > a: guest panic > b: qemu panic (e.g. if KVM_RUN return EFAULT) > > I think for b, the current behaviour might be better.
(b) is not a guest panic, it's "INTERNAL_ERROR" right? It would be easy to accomodate the difference. I tend to agree, since one may want to play with the monitor in that case (e.g. x/10i $pc-20). > In any > case I want a tuneable and either -no-panic or the new -no-shutdown > would allow that. Let's change -no-shutdown then. Actually I think we might even change it in 2.8, since for example Libvirt always uses -no-shutdown and everyone else that doesn't use it would probably hang on panics. >>> void qemu_system_guest_panicked(void) >>> { >>> + if (no_panic) >>> + return qemu_system_shutdown_request(); >>> if (current_cpu) { >>> current_cpu->crash_occurred = true; >>> } I think the "if (no_panic)" should go at the end so that the SHUTDOWN event is sent after GUEST_PANICKED. You would also have to add 'poweroff' to the GuestPanicAction enum too, adjusting qemu_system_guest_panicked's call to qapi_event_send_guest_panicked. >>> @@ -3780,6 +3783,9 @@ int main(int argc, char **argv, char **envp) >>> case QEMU_OPTION_no_shutdown: >>> no_shutdown = 1; >>> break; >>> + case QEMU_OPTION_no_panic: >>> + no_panic = 1; >>> + break; >>> case QEMU_OPTION_show_cursor: >>> cursor_hide = 0; >>> break; >>> -- >>> 2.5.5 >>> >>> >> > > >