From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 94B04C83003 for ; Wed, 29 Apr 2020 07:21:32 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4703A2076B for ; Wed, 29 Apr 2020 07:21:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="YPBuMTW1" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4703A2076B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jTh1f-0003q1-L1; Wed, 29 Apr 2020 07:20:59 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jTh1e-0003pw-8B for xen-devel@lists.xenproject.org; Wed, 29 Apr 2020 07:20:58 +0000 X-Inumbo-ID: f8675ac2-89e9-11ea-b07b-bc764e2007e4 Received: from us-smtp-1.mimecast.com (unknown [205.139.110.61]) by us1-rack-iad1.inumbo.com (Halon) with ESMTP id f8675ac2-89e9-11ea-b07b-bc764e2007e4; Wed, 29 Apr 2020 07:20:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1588144857; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LuKMz2cunkuyvgsHrtA6mHRQurhlf+Q6ZpdMc5OyeVA=; b=YPBuMTW12EnWYveR326vcqxkUUOw4frNJbAtyhAipiuA0hgFz5JL6whaTMw2e4O+Mnfxbt 9gurWbor2RBwrMN0b2Sq0sbQH2yv2DuyF1tAnNRAHqhKp6IUTJyzEvcYv19xLPoYOp81kT 0wqxC3oboz2YgAv5ig0GfGr4fNLkklE= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-212-PhhyA91fOTm_1kO8hKGi9g-1; Wed, 29 Apr 2020 03:20:55 -0400 X-MC-Unique: PhhyA91fOTm_1kO8hKGi9g-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id CB9DFBFC5; Wed, 29 Apr 2020 07:20:53 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-113-6.ams2.redhat.com [10.36.113.6]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 75ED25D779; Wed, 29 Apr 2020 07:20:53 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 3BA1911358D0; Wed, 29 Apr 2020 09:20:49 +0200 (CEST) From: Markus Armbruster To: qemu-devel@nongnu.org Subject: [PULL 19/32] xen/pt: Fix flawed conversion to realize() Date: Wed, 29 Apr 2020 09:20:35 +0200 Message-Id: <20200429072048.29963-20-armbru@redhat.com> In-Reply-To: <20200429072048.29963-1-armbru@redhat.com> References: <20200429072048.29963-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Anthony Perard , xen-devel@lists.xenproject.org, Stefano Stabellini , Paul Durrant Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" The conversion of xen_pt_initfn() to xen_pt_realize() blindly replaced XEN_PT_ERR() by error_setg(). Several error conditions that did not fail xen_pt_initfn() now fail xen_pt_realize(). Unsurprisingly, the cleanup on these errors looks highly suspicious. Revert the inappropriate replacements. Fixes: 5a11d0f7549e24a10e178a9dc8ff5e698031d9a6 Cc: Stefano Stabellini Cc: Anthony Perard Cc: Paul Durrant Cc: xen-devel@lists.xenproject.org Signed-off-by: Markus Armbruster Reviewed-by: Paul Durrant Message-Id: <20200422130719.28225-10-armbru@redhat.com> --- hw/xen/xen_pt.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/hw/xen/xen_pt.c b/hw/xen/xen_pt.c index b91082cb8b..81d5ad8da7 100644 --- a/hw/xen/xen_pt.c +++ b/hw/xen/xen_pt.c @@ -858,8 +858,8 @@ static void xen_pt_realize(PCIDevice *d, Error **errp) =20 rc =3D xc_physdev_map_pirq(xen_xc, xen_domid, machine_irq, &pirq); if (rc < 0) { - error_setg_errno(errp, errno, "Mapping machine irq %u to" - " pirq %i failed", machine_irq, pirq); + XEN_PT_ERR(d, "Mapping machine irq %u to pirq %i failed, (err: %d)= \n", + machine_irq, pirq, errno); =20 /* Disable PCI intx assertion (turn on bit10 of devctl) */ cmd |=3D PCI_COMMAND_INTX_DISABLE; @@ -880,8 +880,8 @@ static void xen_pt_realize(PCIDevice *d, Error **errp) PCI_SLOT(d->devfn), e_intx); if (rc < 0) { - error_setg_errno(errp, errno, "Binding of interrupt %u failed"= , - e_intx); + XEN_PT_ERR(d, "Binding of interrupt %i failed! (err: %d)\n", + e_intx, errno); =20 /* Disable PCI intx assertion (turn on bit10 of devctl) */ cmd |=3D PCI_COMMAND_INTX_DISABLE; @@ -889,8 +889,8 @@ static void xen_pt_realize(PCIDevice *d, Error **errp) =20 if (xen_pt_mapped_machine_irq[machine_irq] =3D=3D 0) { if (xc_physdev_unmap_pirq(xen_xc, xen_domid, machine_irq))= { - error_setg_errno(errp, errno, "Unmapping of machine" - " interrupt %u failed", machine_irq); + XEN_PT_ERR(d, "Unmapping of machine interrupt %i faile= d!" + " (err: %d)\n", machine_irq, errno); } } s->machine_irq =3D 0; --=20 2.21.1