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=-5.0 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 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 BF516C433E0 for ; Tue, 7 Jul 2020 19:44:33 +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 9282C206BE for ; Tue, 7 Jul 2020 19:44:33 +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="SK0gdn0I" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9282C206BE 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 1jstVq-0000JF-0z; Tue, 07 Jul 2020 19:44:18 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jstVo-0000J2-Sp for xen-devel@lists.xenproject.org; Tue, 07 Jul 2020 19:44:16 +0000 X-Inumbo-ID: 3d3ea318-c08a-11ea-bca7-bc764e2007e4 Received: from us-smtp-1.mimecast.com (unknown [207.211.31.120]) by us1-rack-iad1.inumbo.com (Halon) with ESMTP id 3d3ea318-c08a-11ea-bca7-bc764e2007e4; Tue, 07 Jul 2020 19:44:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1594151054; 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=ZfMfperoI6IR1+/lO21emHFoYMQUVo5XjIjuDXPGCjc=; b=SK0gdn0IFQQlFTzvjUrrzEw03W8s3EGInuk83Y7lk6/QVgUVxWKv4L+sQeLkAKwv5C/qLY 8CTsKIRLoQqPPBg0H8NuLW7Hz0OKVt49mnr8e+s9OheaRBfu/vBiDsnCFwdxGy0gaRYXYT y4N3KzuWLgV8n8vpJthLXDrFzFSDtD4= 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-309-FVu01SLLMvS_nSwA9aNUZw-1; Tue, 07 Jul 2020 15:44:11 -0400 X-MC-Unique: FVu01SLLMvS_nSwA9aNUZw-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3B9458015FA; Tue, 7 Jul 2020 19:44:09 +0000 (UTC) Received: from [10.3.115.46] (ovpn-115-46.phx2.redhat.com [10.3.115.46]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3B4715D9DC; Tue, 7 Jul 2020 19:43:55 +0000 (UTC) Subject: Re: [PATCH v12 7/8] nbd: Use ERRP_AUTO_PROPAGATE() To: Markus Armbruster , qemu-devel@nongnu.org References: <20200707165037.1026246-1-armbru@redhat.com> <20200707165037.1026246-8-armbru@redhat.com> From: Eric Blake Organization: Red Hat, Inc. Message-ID: <88ceae2e-eb02-de34-9210-354423bab4a4@redhat.com> Date: Tue, 7 Jul 2020 14:43:54 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: <20200707165037.1026246-8-armbru@redhat.com> Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=eblake@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit 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: Kevin Wolf , vsementsov@virtuozzo.com, qemu-block@nongnu.org, Paul Durrant , =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= , Christian Schoenebeck , Michael Roth , groug@kaod.org, Stefano Stabellini , Gerd Hoffmann , Stefan Hajnoczi , Anthony Perard , xen-devel@lists.xenproject.org, Max Reitz , Laszlo Ersek Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" On 7/7/20 11:50 AM, Markus Armbruster wrote: > From: Vladimir Sementsov-Ogievskiy > > If we want to add some info to errp (by error_prepend() or > error_append_hint()), we must use the ERRP_AUTO_PROPAGATE macro. > Otherwise, this info will not be added when errp == &error_fatal > (the program will exit prior to the error_append_hint() or > error_prepend() call). Fix such cases. > > If we want to check error after errp-function call, we need to > introduce local_err and then propagate it to errp. Instead, use > ERRP_AUTO_PROPAGATE macro, benefits are: > 1. No need of explicit error_propagate call > 2. No need of explicit local_err variable: use errp directly > 3. ERRP_AUTO_PROPAGATE leaves errp as is if it's not NULL or > &error_fatal, this means that we don't break error_abort > (we'll abort on error_set, not on error_propagate) > > This commit is generated by command > > sed -n '/^Network Block Device (NBD)$/,/^$/{s/^F: //p}' \ > MAINTAINERS | \ > xargs git ls-files | grep '\.[hc]$' | \ > xargs spatch \ > --sp-file scripts/coccinelle/auto-propagated-errp.cocci \ > --macro-file scripts/cocci-macro-file.h \ > --in-place --no-show-diff --max-width 80 > > Reported-by: Kevin Wolf > Reported-by: Greg Kurz > Signed-off-by: Vladimir Sementsov-Ogievskiy > Reviewed-by: Markus Armbruster > [Commit message tweaked] > Signed-off-by: Markus Armbruster > --- Reviewed-by: Eric Blake -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226 Virtualization: qemu.org | libvirt.org