From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58086) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bw93N-0005wt-A9 for qemu-devel@nongnu.org; Mon, 17 Oct 2016 10:38:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bw93I-0004WY-CY for qemu-devel@nongnu.org; Mon, 17 Oct 2016 10:38:13 -0400 Received: from mail-lf0-x242.google.com ([2a00:1450:4010:c07::242]:35320) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1bw93I-0004W1-3j for qemu-devel@nongnu.org; Mon, 17 Oct 2016 10:38:08 -0400 Received: by mail-lf0-x242.google.com with SMTP id x79so27139485lff.2 for ; Mon, 17 Oct 2016 07:38:07 -0700 (PDT) Sender: Paolo Bonzini References: <1476706440-112198-1-git-send-email-borntraeger@de.ibm.com> <556323133.4026709.1476708647964.JavaMail.zimbra@redhat.com> <22a981f0-4510-4c1f-0562-35cc792df594@de.ibm.com> From: Paolo Bonzini Message-ID: Date: Mon, 17 Oct 2016 16:37:59 +0200 MIME-Version: 1.0 In-Reply-To: <22a981f0-4510-4c1f-0562-35cc792df594@de.ibm.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH/RFC] vl: add no-panic option List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Christian Borntraeger Cc: qemu-devel@nongnu.org, Markus Armbruster 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 >>> >>> >> > > >