Received: by 2002:adf:ef42:0:0:0:0:0 with SMTP id c2csp1088127wrp; Thu, 19 Sep 2019 07:46:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqyotN+siCbMTL2EEeqTzYlIu4QXM6y+1NLqYnuEYr19E+K0KHEpsoH8hk157jDti6sarrcb X-Received: by 2002:a05:6402:74c:: with SMTP id p12mr4729741edy.135.1568904404922; Thu, 19 Sep 2019 07:46:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568904404; cv=none; d=google.com; s=arc-20160816; b=zNiCzwVJBZZ2Duvu7Z9KFKKDYYCnywXQPaBjT4+4GStmmWIKCwRVWH3JsDX9h8Zq5z PHdjDAGwNb58zPeD7p3Adl/0qnTddDoUE8zM/cvq/vQ/vvyrS9Q7B293XdzafpbB6Te8 f/1IdIKawZWjUODtqW7lNI2Wm14GZe62cAT5Ljcz6V8hDMDXYskXJEAG18W0qzbOxSUg 7YoUB7lbpqQr4DiYj7pnMRhWjJ8rNEqGiWdXCfzSY+171hWqJIMfUKbDA0SAnlpyMfqK j25bKBSasdTfUYumrdkONKJ2Kb9/tp2DhJ++LfPbr12W0snXlhVy8pq/Wo4y+/BdzOZZ 1kxw== 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:subject :content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:organization:autocrypt:openpgp:from :references:to; bh=MgDXb8fMSqqu90B7sGPYUyXz0t8sZsgFLbk2VZmYqks=; b=bkW/0g+dn/PPRh+T0+aQuzDzGUuAgUUs2VDaNXw8UNNUuwo+9T2WjbqXjClvBnIU8S tAxCK2+q5huLZpZqpJpqVDSeaBOxD54O8NfsAZtBfVlMjpm+qcjFY3rYr4AwMU7AkSn4 0NVoxMYyDlV5/tut6sjrcqqvS1atuKZRecMPmxJGZzmvYM+yHM6rOviBqUaEe2DAM7XX mTbSRTr0TUh7kup5C42yzh2DcFQzPklkM9AIP+hePVJjBBBzhMavFuMD4YtbbQV58PlI eD8gWn2c8eKig8+PdfZGyGii0ywiWeV+PgR0HWzdyswjXxbG7M/9FyxEu7clc3g6MCv6 /hRg== 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"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d1si5169567edr.446.2019.09.19.07.46.44 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Sep 2019 07:46:44 -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"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from localhost ([::1]:45104 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iAxhj-0005Wz-2x for alex.bennee@linaro.org; Thu, 19 Sep 2019 10:46:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58035) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iAxgJ-0004ue-55 for qemu-arm@nongnu.org; Thu, 19 Sep 2019 10:45:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iAxfg-0008CC-DJ for qemu-arm@nongnu.org; Thu, 19 Sep 2019 10:44:37 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47013) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iAxfg-0008Bp-5S; Thu, 19 Sep 2019 10:44:36 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 26D7118C427A; Thu, 19 Sep 2019 14:44:35 +0000 (UTC) Received: from [10.3.116.249] (ovpn-116-249.phx2.redhat.com [10.3.116.249]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2FBDA10018F8; Thu, 19 Sep 2019 14:44:15 +0000 (UTC) To: Vladimir Sementsov-Ogievskiy , Kevin Wolf References: <20190918130244.24257-1-vsementsov@virtuozzo.com> <20190919091720.GB10163@localhost.localdomain> <57483252-273c-4606-47a8-eddeb840109a@redhat.com> <35c972e1-bdb5-cbcb-ed45-6a51f19af98c@virtuozzo.com> <696673be-95c8-3f75-551c-26fccd230eb1@virtuozzo.com> From: Eric Blake Openpgp: preference=signencrypt Autocrypt: addr=eblake@redhat.com; keydata= xsBNBEvHyWwBCACw7DwsQIh0kAbUXyqhfiKAKOTVu6OiMGffw2w90Ggrp4bdVKmCaEXlrVLU xphBM8mb+wsFkU+pq9YR621WXo9REYVIl0FxKeQo9dyQBZ/XvmUMka4NOmHtFg74nvkpJFCD TUNzmqfcjdKhfFV0d7P/ixKQeZr2WP1xMcjmAQY5YvQ2lUoHP43m8TtpB1LkjyYBCodd+LkV GmCx2Bop1LSblbvbrOm2bKpZdBPjncRNob73eTpIXEutvEaHH72LzpzksfcKM+M18cyRH+nP sAd98xIbVjm3Jm4k4d5oQyE2HwOur+trk2EcxTgdp17QapuWPwMfhaNq3runaX7x34zhABEB AAHNHkVyaWMgQmxha2UgPGVibGFrZUByZWRoYXQuY29tPsLAegQTAQgAJAIbAwULCQgHAwUV CgkICwUWAgMBAA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 2UXYsMAr/uUncSKlfjvArhsej0S4zbqim2ZY6S8aRWw94J3bSvJR+Nwbs34GPTD4Pg== Organization: Red Hat, Inc. Message-ID: <152afb5b-8efb-d968-d595-94f58ad02a04@redhat.com> Date: Thu, 19 Sep 2019 09:44:14 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <696673be-95c8-3f75-551c-26fccd230eb1@virtuozzo.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.62]); Thu, 19 Sep 2019 14:44:35 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: Re: [Qemu-arm] [RFC] error: auto propagated local_err 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" , "peter.maydell@linaro.org" , "mst@redhat.com" , "codyprime@gmail.com" , "mark.cave-ayland@ilande.co.uk" , "qemu-devel@nongnu.org" , "armbru@redhat.com" , "kraxel@redhat.com" , "mreitz@redhat.com" , "qemu-block@nongnu.org" , "quintela@redhat.com" , "david@redhat.com" , "mdroth@linux.vnet.ibm.com" , "pasic@linux.ibm.com" , "borntraeger@de.ibm.com" , "marcandre.lureau@redhat.com" , "rth@twiddle.net" , "farman@linux.ibm.com" , "groug@kaod.org" , "dgilbert@redhat.com" , "alex.williamson@redhat.com" , "qemu-arm@nongnu.org" , "stefanha@redhat.com" , "jsnow@redhat.com" , "david@gibson.dropbear.id.au" , "berrange@redhat.com" , "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: cmk7KJbY/A3k On 9/19/19 9:30 AM, Vladimir Sementsov-Ogievskiy wrote: >> >> To the same topic, of minimization: should we always call MAKE_ERRP_SAFE at function top, or only >> in block, where it is needed (assume, we dereference it only inside some "if" or "while"? >> Kevin, is something bad in propagation, when it not related to error_abort? >> >> > > Or, even, we may use MAKE_ERRP_SAFE on every function, which have Error **errp argument, even if we neither > dereference it nor append hints? Is it what you propose by "SINGLE paradigm"? It's of course simpler to script, > to check in checkpatch and to maintain. Yes. The simpler we make the rules, and the less boilerplate it entails, the more likely that we can: a) avoid exceptions and corner cases that cost review time b) automate the conversion into complying with the rule c) codify those rules in syntax check to ensure they are followed post-conversion ALWAYS using MAKE_ERRP_SAFE() on entry to any function that has an Error **errp parameter is dirt-simple to explain. It has no performance penalty if the user passed in a normal error or error_abort (the cost of an 'if' hidden in the macro is probably negligible compared to everything else we do), and has no semantic penalty if the user passed in NULL or error_fatal (we now get the behavior we want with less boilerplate). Having to think 'does this method require me to use MAKE_ERRP_SAFE, or can I omit it?' does not provide the same simplicity. -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226 Virtualization: qemu.org | libvirt.org