Received: by 2002:adf:e804:0:0:0:0:0 with SMTP id o4csp4935769wrm; Tue, 8 Oct 2019 02:40:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqzMRstRC6ECgkQ2xgF/iQn7gTkEmLK4shsbUgns48a4Ds1uulthapFaCFSWT/st51DHpbkP X-Received: by 2002:a17:906:d92c:: with SMTP id rn12mr27482775ejb.16.1570527652515; Tue, 08 Oct 2019 02:40:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570527652; cv=none; d=google.com; s=arc-20160816; b=k7CIINCu0IOd7EPZ+ZWGbosxlMxgMgiC7KXxH29Lc7rqHnVoGDQDPQ9ggIQyXhoTsm +k2pkyZFnaxi8xnZSMCpjIceAWqgiJbVvGiUEYZ6Bw0TNJ7xqeLsx8EMOEhcNworUjvq oWMZcgGBn2LsyPRHXc3IO9KKHpcrwxPlHwZcG2ZrTrpxoryGZ1K+vCnvprSL+t/DkDC1 ryyIji0QX14lVdVNNRKvRFbNkM27zL4xSQiFLsaunks7ecE2KVNL5InRGSvB4N6BhkW5 o+D6rPyisoqa+rnUCuc7l2pZn46+dJ9cD/CubXO74W5RlW7/3dGj6c+aMw+asPNgfDnf 5S2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:subject:to:from:date; bh=YeyHe1Ji5/fa/3QIGV3vYMW+UxY0g08F58QMRXLGqGM=; b=CRh28sMTI7eL0wziNEXtwCKVAb/ArPjAAJyCV7a2agJgLXQolmu0kdMzQCj7Lvs+10 uDphRBZfjw9SAuhY+CDDhYCsF23hG47ejieJZCnzwfk9LYMEBB6OKlbvqkLqMuQMdMB/ PJ2Tk9/Z+qagTvUarlyUryYU/dEGDb4U4ughhGuFDOXoPrMajnyXL1wqOv93CyDQe9gr oNXSUqx487ewigiQTcunDDKKvR231xNR5pl64lBcuAcuHY3iUngj3Fn4pukKvfAJhYxe tSyyZYmbMrVSoKqj1YdzwPjIcZCgLcqAd82yHj6Dn7jVpx07b3pMtIJXejNIAeDlfHNU VPzg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id e49si10718242edb.87.2019.10.08.02.40.52 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 08 Oct 2019 02:40:52 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org" Received: from localhost ([::1]:53004 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iHlz9-0005vp-EV for alex.bennee@linaro.org; Tue, 08 Oct 2019 05:40:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37965) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iHlyw-0005sU-S8 for qemu-arm@nongnu.org; Tue, 08 Oct 2019 05:40:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iHlyr-00053C-Dy for qemu-arm@nongnu.org; Tue, 08 Oct 2019 05:40:38 -0400 Received: from 2.mo2.mail-out.ovh.net ([188.165.53.149]:57238) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iHlyr-000520-1e for qemu-arm@nongnu.org; Tue, 08 Oct 2019 05:40:33 -0400 Received: from player699.ha.ovh.net (unknown [10.108.54.74]) by mo2.mail-out.ovh.net (Postfix) with ESMTP id 631A31AEC56 for ; Tue, 8 Oct 2019 11:40:30 +0200 (CEST) Received: from kaod.org (lns-bzn-46-82-253-208-248.adsl.proxad.net [82.253.208.248]) (Authenticated sender: groug@kaod.org) by player699.ha.ovh.net (Postfix) with ESMTPSA id 4C3A3AB07787; Tue, 8 Oct 2019 09:39:34 +0000 (UTC) Date: Tue, 8 Oct 2019 11:39:32 +0200 From: Greg Kurz To: Vladimir Sementsov-Ogievskiy Subject: Re: [PATCH v4 00/31] error: auto propagated local_err Message-ID: <20191008113932.18eb4c1d@bahia.lan> In-Reply-To: References: <20191001155319.8066-1-vsementsov@virtuozzo.com> <87eeznn185.fsf@dusky.pond.sub.org> X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Ovh-Tracer-Id: 6452813842595354963 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedufedrheelgddvtdcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemucehtddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 188.165.53.149 X-BeenThere: qemu-arm@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "fam@euphon.net" , "pburton@wavecomp.com" , "peter.maydell@linaro.org" , "codyprime@gmail.com" , "jasowang@redhat.com" , "mark.cave-ayland@ilande.co.uk" , "qemu-devel@nongnu.org" , Markus Armbruster , "kraxel@redhat.com" , "mreitz@redhat.com" , "qemu-block@nongnu.org" , "quintela@redhat.com" , "arikalo@wavecomp.com" , "mst@redhat.com" , "mdroth@linux.vnet.ibm.com" , "pasic@linux.ibm.com" , "borntraeger@de.ibm.com" , "joel@jms.id.au" , "marcandre.lureau@redhat.com" , "david@gibson.dropbear.id.au" , "farman@linux.ibm.com" , "ehabkost@redhat.com" , "sw@weilnetz.de" , "dgilbert@redhat.com" , "yuval.shaia@oracle.com" , "alex.williamson@redhat.com" , "qemu-arm@nongnu.org" , "clg@kaod.org" , "stefanha@redhat.com" , "david@redhat.com" , "jsnow@redhat.com" , "rth@twiddle.net" , "kwolf@redhat.com" , "integration@gluster.org" , "berrange@redhat.com" , "andrew@aj.id.au" , "cohuck@redhat.com" , "qemu-s390x@nongnu.org" , "sundeep.lkml@gmail.com" , "qemu-ppc@nongnu.org" , "pbonzini@redhat.com" Errors-To: qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org Sender: "Qemu-arm" X-TUID: tHIsFSxl6Zjj On Tue, 8 Oct 2019 08:41:08 +0000 Vladimir Sementsov-Ogievskiy wrote: > 08.10.2019 10:30, Markus Armbruster wrote: > > Vladimir Sementsov-Ogievskiy writes: > > > >> Hi all! > >> > >> Here is a proposal of auto propagation for local_err, to not call > >> error_propagate on every exit point, when we deal with local_err. > >> > >> There are also two issues with errp: > >> > >> 1. error_fatal & error_append_hint/error_prepend: user can't see this > >> additional info, because exit() happens in error_setg earlier than info > >> is added. [Reported by Greg Kurz] > > > > How is this series related to Greg's "[PATCH 00/17] Fix usage of > > error_append_hint()"? Do we need both? > > These series is a substitution for Greg's. Still, there are problems with > automation, which Greg pointed in 21/31, and I don't know what to do next. > > May be, just continue to review patches and fix them by hand. May be try to > improve automation... > The feeling I have after working on my series is that the lines that deal with errors are mixed up with the functional code in a variety of ways. That makes it very difficult if not impossible to come with code patterns suitable for a 100% automated solution IMHO. My questioning is more around the semantics of error_fatal actually. What does passing &error_fatal gives us over passing &local_err and calling error_report_err()+exit(), apart from breaking error_append_hint() and error_prepend() ? > > > >> 2. error_abort & error_propagate: when we wrap > >> error_abort by local_err+error_propagate, resulting coredump will > >> refer to error_propagate and not to the place where error happened. > >> (the macro itself don't fix the issue, but it allows to [3.] drop all > >> local_err+error_propagate pattern, which will definitely fix the issue) > >> [Reported by Kevin Wolf] > >> > >> Still, applying new macro to all errp-functions is a huge task, which is > >> impossible to solve in one series. > >> > >> So, here is a minimum: solve only [1.], by adding new macro to all > >> errp-functions which wants to call error_append_hint. > >> > >> v4; > >> 02: - check errp to be not NULL > >> - drop Eric's r-b > >> 03: add Eric's r-b > >> 04: - rename macro to ERRP_AUTO_PROPAGATE [Kevin] > >> - improve comment and commit msg, mention > >> error_prepend > >> 05: - handle error_prepend too > >> - use new macro name > >> - drop empty line at the end > >> > >> commit message for auto-generated commits updated, > >> commits regenerated. > >> > >> I'll use cc-cmd to cc appropriate recipients per patch, still > >> cover-letter together with 04-06 patches should be interesting for > >> all: > > [...] > > > > Big series; let me guess its structure. > > > >> Vladimir Sementsov-Ogievskiy (31): > >> errp: rename errp to errp_in where it is IN-argument > >> hw/core/loader-fit: fix freeing errp in fit_load_fdt > >> net/net: fix local variable shadowing in net_client_init > > > > Preparations. > > > >> error: auto propagated local_err > > > > The new idea. > > > >> scripts: add script to fix error_append_hint/error_prepend usage > >> python: add commit-per-subsystem.py > > > > Scripts to help you apply it. > > > >> s390: Fix error_append_hint/error_prepend usage > >> ARM TCG CPUs: Fix error_append_hint/error_prepend usage > >> PowerPC TCG CPUs: Fix error_append_hint/error_prepend usage > >> arm: Fix error_append_hint/error_prepend usage > >> SmartFusion2: Fix error_append_hint/error_prepend usage > >> ASPEED BMCs: Fix error_append_hint/error_prepend usage > >> Boston: Fix error_append_hint/error_prepend usage > >> PowerNV (Non-Virtualized): Fix error_append_hint/error_prepend usage > >> PCI: Fix error_append_hint/error_prepend usage > >> SCSI: Fix error_append_hint/error_prepend usage > >> USB: Fix error_append_hint/error_prepend usage > >> VFIO: Fix error_append_hint/error_prepend usage > >> vhost: Fix error_append_hint/error_prepend usage > >> virtio: Fix error_append_hint/error_prepend usage > >> virtio-9p: Fix error_append_hint/error_prepend usage > >> XIVE: Fix error_append_hint/error_prepend usage > >> block: Fix error_append_hint/error_prepend usage > >> chardev: Fix error_append_hint/error_prepend usage > >> cmdline: Fix error_append_hint/error_prepend usage > >> QOM: Fix error_append_hint/error_prepend usage > >> Migration: Fix error_append_hint/error_prepend usage > >> Sockets: Fix error_append_hint/error_prepend usage > >> nbd: Fix error_append_hint/error_prepend usage > >> PVRDMA: Fix error_append_hint/error_prepend usage > >> ivshmem: Fix error_append_hint/error_prepend usage > > > > Applying it. > > > > Correct? > > > > Yes > >