From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51472) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gChB4-0000Kw-Uw for qemu-devel@nongnu.org; Wed, 17 Oct 2018 04:27:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gChB2-0001y9-16 for qemu-devel@nongnu.org; Wed, 17 Oct 2018 04:27:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44226) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gChB1-0001Oq-Np for qemu-devel@nongnu.org; Wed, 17 Oct 2018 04:27:35 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BB21680E7B for ; Wed, 17 Oct 2018 08:27:18 +0000 (UTC) From: Markus Armbruster Date: Wed, 17 Oct 2018 10:26:34 +0200 Message-Id: <20181017082702.5581-11-armbru@redhat.com> In-Reply-To: <20181017082702.5581-1-armbru@redhat.com> References: <20181017082702.5581-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH v4 10/38] ioapic: Fix error handling in realize() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Xu Calling error_report() in a function that takes an Error ** argument is suspicious. ioapic_realize() does that, and then exit()s. Currently mostly harmless, as the device cannot be hot-plugged. Fixes: 20fd4b7b6d9282fe0cb83601f1821f31bd257458 Cc: Peter Xu Signed-off-by: Markus Armbruster Reviewed-by: Peter Xu Reviewed-by: Marc-Andr=C3=A9 Lureau --- hw/intc/ioapic.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/intc/ioapic.c b/hw/intc/ioapic.c index b6896ac4ce..4e529729b4 100644 --- a/hw/intc/ioapic.c +++ b/hw/intc/ioapic.c @@ -21,7 +21,7 @@ */ =20 #include "qemu/osdep.h" -#include "qemu/error-report.h" +#include "qapi/error.h" #include "monitor/monitor.h" #include "hw/hw.h" #include "hw/i386/pc.h" @@ -393,9 +393,9 @@ static void ioapic_realize(DeviceState *dev, Error **= errp) IOAPICCommonState *s =3D IOAPIC_COMMON(dev); =20 if (s->version !=3D 0x11 && s->version !=3D 0x20) { - error_report("IOAPIC only supports version 0x11 or 0x20 " - "(default: 0x%x).", IOAPIC_VER_DEF); - exit(1); + error_setg(errp, "IOAPIC only supports version 0x11 or 0x20 " + "(default: 0x%x).", IOAPIC_VER_DEF); + return; } =20 memory_region_init_io(&s->io_memory, OBJECT(s), &ioapic_io_ops, s, --=20 2.17.1