From nobody Tue Oct 28 04:11:07 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1514540794773354.246890268294; Fri, 29 Dec 2017 01:46:34 -0800 (PST) Received: from localhost ([::1]:34620 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eUrFJ-0005gG-9z for importer@patchew.org; Fri, 29 Dec 2017 04:46:33 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33233) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eUrCY-0003ou-2p for qemu-devel@nongnu.org; Fri, 29 Dec 2017 04:43:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eUrCX-0000aB-9U for qemu-devel@nongnu.org; Fri, 29 Dec 2017 04:43:42 -0500 Received: from mx1.redhat.com ([209.132.183.28]:36930) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eUrCX-0000Z1-34 for qemu-devel@nongnu.org; Fri, 29 Dec 2017 04:43:41 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2B9257EA80; Fri, 29 Dec 2017 09:43:40 +0000 (UTC) Received: from dritchie.redhat.com (ovpn-116-168.ams2.redhat.com [10.36.116.168]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7C2A9600D4; Fri, 29 Dec 2017 09:43:37 +0000 (UTC) From: Sergio Lopez To: f4bug@amsat.org, mjt@tls.msk.ru, pbonzini@redhat.com, qemu-devel@nongnu.org Date: Fri, 29 Dec 2017 10:42:06 +0100 Message-Id: <20171229094206.14512-3-slp@redhat.com> In-Reply-To: <20171229094206.14512-1-slp@redhat.com> References: <20171229094206.14512-1-slp@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Fri, 29 Dec 2017 09:43:40 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 2/2] pvpanic: add PVPANIC_ABORT_PROP 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: Sergio Lopez Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" PVPANIC_ABORT_PROP is a boolean to instruct pvpanic to request an abort() of the process when the Guest signals a panic. Signed-off-by: Sergio Lopez --- hw/misc/pvpanic.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/hw/misc/pvpanic.c b/hw/misc/pvpanic.c index 4fb074df06..c901458297 100644 --- a/hw/misc/pvpanic.c +++ b/hw/misc/pvpanic.c @@ -28,7 +28,7 @@ #define ISA_PVPANIC_DEVICE(obj) \ OBJECT_CHECK(PVPanicState, (obj), TYPE_PVPANIC) =20 -static void handle_event(int event) +static void handle_event(int event, bool abort_on_panic) { static bool logged; =20 @@ -38,7 +38,7 @@ static void handle_event(int event) } =20 if (event & PVPANIC_PANICKED) { - qemu_system_guest_panicked(NULL, false); + qemu_system_guest_panicked(NULL, abort_on_panic); return; } } @@ -50,6 +50,7 @@ typedef struct PVPanicState { =20 MemoryRegion io; uint16_t ioport; + bool abort_on_panic; } PVPanicState; =20 /* return supported events on read */ @@ -61,7 +62,8 @@ static uint64_t pvpanic_ioport_read(void *opaque, hwaddr = addr, unsigned size) static void pvpanic_ioport_write(void *opaque, hwaddr addr, uint64_t val, unsigned size) { - handle_event(val); + PVPanicState *s =3D opaque; + handle_event(val, s->abort_on_panic); } =20 static const MemoryRegionOps pvpanic_ops =3D { @@ -100,6 +102,7 @@ static void pvpanic_isa_realizefn(DeviceState *dev, Err= or **errp) } =20 #define PVPANIC_IOPORT_PROP "ioport" +#define PVPANIC_ABORT_PROP "abort" =20 uint16_t pvpanic_port(void) { @@ -112,6 +115,7 @@ uint16_t pvpanic_port(void) =20 static Property pvpanic_isa_properties[] =3D { DEFINE_PROP_UINT16(PVPANIC_IOPORT_PROP, PVPanicState, ioport, 0x505), + DEFINE_PROP_BOOL(PVPANIC_ABORT_PROP, PVPanicState, abort_on_panic, fal= se), DEFINE_PROP_END_OF_LIST(), }; =20 --=20 2.14.3