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.6 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 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 8E2BBC35669 for ; Sat, 22 Feb 2020 08:24:53 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (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 579CF20707 for ; Sat, 22 Feb 2020 08:24:53 +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="Ibknjp5y" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 579CF20707 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:40126 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j5Q5k-0000Vn-K1 for qemu-devel@archiver.kernel.org; Sat, 22 Feb 2020 03:24:52 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:33161) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j5Q58-0008Qs-Cb for qemu-devel@nongnu.org; Sat, 22 Feb 2020 03:24:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j5Q56-00050d-Hp for qemu-devel@nongnu.org; Sat, 22 Feb 2020 03:24:14 -0500 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:60354 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j5Q56-00050E-ED for qemu-devel@nongnu.org; Sat, 22 Feb 2020 03:24:12 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582359851; 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=T45vrP9XIhTb9vS7RjFPPl1JpkYIOutb0fUu3RFTTrw=; b=Ibknjp5yCD9t8t8M1bLmQSxRwMfGL24Jt/+owGZ9h5EqoQ24qkat4Tr6Rwln85defxydlu ffKxfpWGYsQ6H0UTCWxUjW5DqwfcGv5Khgun91oUtol/h82gp9FTvZvjEHzEvN0UWOJONJ IftnMcfhyMG6bv0kjqgqkg2xesXmQ40= 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-385-52XP2uA5M1qKR3W2VghM7A-1; Sat, 22 Feb 2020 03:24:09 -0500 X-MC-Unique: 52XP2uA5M1qKR3W2VghM7A-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B4A4C189F760; Sat, 22 Feb 2020 08:24:07 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-129.ams2.redhat.com [10.36.116.129]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2F176391; Sat, 22 Feb 2020 08:24:01 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id A616511386A6; Sat, 22 Feb 2020 09:23:59 +0100 (CET) From: Markus Armbruster To: Vladimir Sementsov-Ogievskiy Subject: Re: [PATCH v7 01/11] qapi/error: add (Error **errp) cleaning APIs References: <20200131130118.1716-1-vsementsov@virtuozzo.com> <20200131130118.1716-2-vsementsov@virtuozzo.com> <87d0a88k6d.fsf@dusky.pond.sub.org> <7856fcbb-8c01-aba3-a11b-63058c117362@virtuozzo.com> <875zfz6gsh.fsf@dusky.pond.sub.org> <064ca8e9-458e-c780-92a0-05f40cf0975b@virtuozzo.com> Date: Sat, 22 Feb 2020 09:23:59 +0100 In-Reply-To: <064ca8e9-458e-c780-92a0-05f40cf0975b@virtuozzo.com> (Vladimir Sementsov-Ogievskiy's message of "Fri, 21 Feb 2020 20:31:55 +0300") Message-ID: <87sgj31140.fsf@dusky.pond.sub.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.120 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Stefano Stabellini , qemu-block@nongnu.org, Paul Durrant , qemu-devel@nongnu.org, Laszlo Ersek , Markus Armbruster , Michael Roth , Greg Kurz , Gerd Hoffmann , Stefan Hajnoczi , Anthony Perard , xen-devel@lists.xenproject.org, Max Reitz , Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= , Stefan Berger Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Vladimir Sementsov-Ogievskiy writes: > 21.02.2020 19:34, Markus Armbruster wrote: >> Vladimir Sementsov-Ogievskiy writes: >> >>> 21.02.2020 10:38, Markus Armbruster wrote: >>>> Vladimir Sementsov-Ogievskiy writes: >>>> >>>>> Add functions to clean Error **errp: call corresponding Error *err >>>>> cleaning function an set pointer to NULL. >>>>> >>>>> New functions: >>>>> error_free_errp >>>>> error_report_errp >>>>> warn_report_errp >>>>> >>>>> Signed-off-by: Vladimir Sementsov-Ogievskiy >>>>> Reviewed-by: Greg Kurz >>>>> Reviewed-by: Eric Blake >>>>> --- >>>>> >>>>> CC: Eric Blake >>>>> CC: Kevin Wolf >>>>> CC: Max Reitz >>>>> CC: Greg Kurz >>>>> CC: Stefano Stabellini >>>>> CC: Anthony Perard >>>>> CC: Paul Durrant >>>>> CC: Stefan Hajnoczi >>>>> CC: "Philippe Mathieu-Daud=C3=A9" >>>>> CC: Laszlo Ersek >>>>> CC: Gerd Hoffmann >>>>> CC: Stefan Berger >>>>> CC: Markus Armbruster >>>>> CC: Michael Roth >>>>> CC: qemu-block@nongnu.org >>>>> CC: xen-devel@lists.xenproject.org >>>>> >>>>> include/qapi/error.h | 26 ++++++++++++++++++++++++++ >>>>> 1 file changed, 26 insertions(+) >>>>> >>>>> diff --git a/include/qapi/error.h b/include/qapi/error.h >>>>> index ad5b6e896d..d34987148d 100644 >>>>> --- a/include/qapi/error.h >>>>> +++ b/include/qapi/error.h >>>>> @@ -309,6 +309,32 @@ void warn_reportf_err(Error *err, const char *fm= t, ...) >>>>> void error_reportf_err(Error *err, const char *fmt, ...) >>>>> GCC_FMT_ATTR(2, 3); >>>>> +/* >>>>> + * Functions to clean Error **errp: call corresponding Error *err cl= eaning >>>>> + * function, then set pointer to NULL. >>>>> + */ >>>>> +static inline void error_free_errp(Error **errp) >>>>> +{ >>>>> + assert(errp && *errp); >>>>> + error_free(*errp); >>>>> + *errp =3D NULL; >>>>> +} >>>>> + >>>>> +static inline void error_report_errp(Error **errp) >>>>> +{ >>>>> + assert(errp && *errp); >>>>> + error_report_err(*errp); >>>>> + *errp =3D NULL; >>>>> +} >>>>> + >>>>> +static inline void warn_report_errp(Error **errp) >>>>> +{ >>>>> + assert(errp && *errp); >>>>> + warn_report_err(*errp); >>>>> + *errp =3D NULL; >>>>> +} >>>>> + >>>>> + >>>>> /* >>>>> * Just like error_setg(), except you get to specify the error cla= ss. >>>>> * Note: use of error classes other than ERROR_CLASS_GENERIC_ERROR= is >>>> >>>> These appear to be unused apart from the Coccinelle script in PATCH 03= . >>>> >>>> They are used in the full "[RFC v5 000/126] error: auto propagated >>>> local_err" series. Options: >>>> >>>> 1. Pick a few more patches into this part I series, so these guys come >>>> with users. >>> >>> It needs some additional effort for this series.. But it's possible. St= ill, >>> I think that we at least should not pull out patches which should be in >>> future series (for example from ppc or block/).. >> >> Yes, we want to keep related stuff together. >> >>> Grepping through v5: >>> for x in {warn_report_errp,error_report_errp,error_free_errp}; do ech= o =3D=3D $x =3D=3D; git grep -l $x | grep -v coccinelle | grep -v 'error\.h= '; echo; done >>> =3D=3D warn_report_errp =3D=3D >>> block/file-posix.c >>> hw/ppc/spapr.c >>> hw/ppc/spapr_caps.c >>> hw/ppc/spapr_irq.c >>> hw/vfio/pci.c >>> net/tap.c >>> qom/object.c >>> >>> =3D=3D error_report_errp =3D=3D >>> hw/block/vhost-user-blk.c >>> util/oslib-posix.c >>> >>> =3D=3D error_free_errp =3D=3D >>> block.c >>> block/qapi.c >>> block/sheepdog.c >>> block/snapshot.c >>> blockdev.c >>> chardev/char-socket.c >>> hw/audio/intel-hda.c >>> hw/core/qdev-properties.c >>> hw/pci-bridge/pci_bridge_dev.c >>> hw/pci-bridge/pcie_pci_bridge.c >>> hw/scsi/megasas.c >>> hw/scsi/mptsas.c >>> hw/usb/hcd-xhci.c >>> io/net-listener.c >>> migration/colo.c >>> qga/commands-posix.c >>> qga/commands-win32.c >>> util/qemu-sockets.c >>> >>> What do you want to add? >> >> PATCH v5 032 uses both error_report_errp() and error_free_errp(). >> Adding warn_report_errp() without a user is okay with me. What do you >> think? >> >> If there are patches you consider related to 032, feel free to throw >> them in. > > 032 is qga/commands-win32.c and util/oslib-posix.c > > Seems that they are wrongly grouped into one patch. > > qga/commands-win32.c matches qga/ (Michael Roth) > and util/oslib-posix.c matches POSIX (Paolo Bonzini) > > So, it should be two separate patches anyway. > > For [1.] I only afraid that we'll have to wait for maintainers, who were > not interested in previous iterations, to review these new patches.. We won't. We should and we will give every maintainer a chance to review these patches, even though the changes are mechanical. Maintainers are free to decline or ignore this offer. I will feel free to interpret that as "go ahead and merge this through your tree". In fact, I fully expect the bulk of the changes to go through my tree. Chasing umpteen maintainers for each one to merge a trivial part of this massive tree-wide change would take ages and accomplish nothing. [...]