From patchwork Mon Oct 17 12:14:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Borntraeger X-Patchwork-Id: 9379095 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id BD59F6086B for ; Mon, 17 Oct 2016 12:14:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B0233291F3 for ; Mon, 17 Oct 2016 12:14:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A41A4291FC; Mon, 17 Oct 2016 12:14:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.4 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 3590A291FA for ; Mon, 17 Oct 2016 12:14:33 +0000 (UTC) Received: from localhost ([::1]:60954 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bw6oK-0002JL-Qw for patchwork-qemu-devel@patchwork.kernel.org; Mon, 17 Oct 2016 08:14:32 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51883) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bw6o5-0002J4-E6 for qemu-devel@nongnu.org; Mon, 17 Oct 2016 08:14:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bw6o0-0001XK-F8 for qemu-devel@nongnu.org; Mon, 17 Oct 2016 08:14:17 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:48470) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1bw6o0-0001X7-6H for qemu-devel@nongnu.org; Mon, 17 Oct 2016 08:14:12 -0400 Received: from pps.filterd (m0098393.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id u9HCDsgx046036 for ; Mon, 17 Oct 2016 08:14:10 -0400 Received: from e06smtp14.uk.ibm.com (e06smtp14.uk.ibm.com [195.75.94.110]) by mx0a-001b2d01.pphosted.com with ESMTP id 264tj52sty-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 17 Oct 2016 08:14:10 -0400 Received: from localhost by e06smtp14.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 17 Oct 2016 13:14:08 +0100 Received: from d06dlp02.portsmouth.uk.ibm.com (9.149.20.14) by e06smtp14.uk.ibm.com (192.168.101.144) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 17 Oct 2016 13:14:05 +0100 Received: from b06cxnps3075.portsmouth.uk.ibm.com (d06relay10.portsmouth.uk.ibm.com [9.149.109.195]) by d06dlp02.portsmouth.uk.ibm.com (Postfix) with ESMTP id 8C337219004D for ; Mon, 17 Oct 2016 13:13:21 +0100 (BST) Received: from d06av04.portsmouth.uk.ibm.com (d06av04.portsmouth.uk.ibm.com [9.149.37.216]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u9HCE4gb30539984 for ; Mon, 17 Oct 2016 12:14:04 GMT Received: from d06av04.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av04.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u9HCE4D8025547 for ; Mon, 17 Oct 2016 06:14:04 -0600 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d06av04.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id u9HCE3J7025521 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 17 Oct 2016 06:14:03 -0600 Received: by tuxmaker.boeblingen.de.ibm.com (Postfix, from userid 25651) id 8772420F048; Mon, 17 Oct 2016 14:14:03 +0200 (CEST) From: Christian Borntraeger To: Paolo Bonzini Date: Mon, 17 Oct 2016 14:14:00 +0200 X-Mailer: git-send-email 2.5.5 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16101712-0016-0000-0000-0000024CFCF7 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16101712-0017-0000-0000-0000236D5945 Message-Id: <1476706440-112198-1-git-send-email-borntraeger@de.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-10-17_05:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1609300000 definitions=main-1610170215 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 148.163.156.1 Subject: [Qemu-devel] [PATCH/RFC] vl: add no-panic option X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Christian Borntraeger , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Some testcase will trigger a guest panic state. For testing purposes it can be useful to exit QEMU anyway. Signed-off-by: Christian Borntraeger --- qemu-options.hx | 9 +++++++++ vl.c | 6 ++++++ 2 files changed, 15 insertions(+) diff --git a/qemu-options.hx b/qemu-options.hx index 01f01df..ee6d3d0 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -3301,6 +3301,15 @@ This allows for instance switching to monitor to commit changes to the disk image. ETEXI +DEF("no-panic", 0, QEMU_OPTION_no_panic, \ + "-no-panic exit QEMU also in guest panic state\n", QEMU_ARCH_ALL) +STEXI +@item -no-panic +@findex -no-panic +Exit QEMU on guest panic instead of keeping it alive. This allows for +instance running tests that are known to panic at the end. +ETEXI + DEF("loadvm", HAS_ARG, QEMU_OPTION_loadvm, \ "-loadvm [tag|id]\n" \ " start right away with a saved state (loadvm in monitor)\n", diff --git a/vl.c b/vl.c index f3abd99..57e1d91 100644 --- a/vl.c +++ b/vl.c @@ -164,6 +164,7 @@ int no_hpet = 0; int fd_bootchk = 1; static int no_reboot; int no_shutdown = 0; +int no_panic = 0; int cursor_hide = 1; int graphic_rotate = 0; const char *watchdog; @@ -1774,6 +1775,8 @@ void qemu_system_reset(bool report) void qemu_system_guest_panicked(void) { + if (no_panic) + return qemu_system_shutdown_request(); if (current_cpu) { current_cpu->crash_occurred = true; } @@ -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;