From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38501) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bhc99-0000ri-6i for qemu-devel@nongnu.org; Wed, 07 Sep 2016 08:40:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bhc93-0006TA-5X for qemu-devel@nongnu.org; Wed, 07 Sep 2016 08:40:06 -0400 Received: from roura.ac.upc.es ([147.83.33.10]:43843) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bhc92-0006Rx-RK for qemu-devel@nongnu.org; Wed, 07 Sep 2016 08:40:01 -0400 From: =?utf-8?Q?Llu=C3=ADs_Vilanova?= References: <1473228390-18669-1-git-send-email-peterx@redhat.com> <87bn00ysg0.fsf@linaro.org> <20160907093308.GA5775@lemon> Date: Wed, 07 Sep 2016 14:39:54 +0200 In-Reply-To: <20160907093308.GA5775@lemon> (Fam Zheng's message of "Wed, 7 Sep 2016 17:33:08 +0800") Message-ID: <87fupbyjc5.fsf@fimbulvetr.bsc.es> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v4 0/4] Introduce error_report_{fatal|abort} List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng Cc: Alex =?utf-8?Q?Benn=C3=A9e?= , peter.maydell@linaro.org, pbonzini@redhat.com, qemu-devel@nongnu.org, Peter Xu , armbru@redhat.com Fam Zheng writes: > On Wed, 09/07 10:23, Alex Benn=C3=A9e wrote: >> Last time I needed to do error reporting I was told the error_setg >> method was the correct way to do it and the report/exit case made sense >> only in the top level. Before we add even more error reporting >> primitives can we update HACKING (or possibly add somethings to docs/) >> that describes when and where the various error report mechanisms should >> be used? > FWIW, the comment of error_setg clarifies the recommended usage now: > ... >> * Please don't error_setg(&error_fatal, ...), use error_report() and >> * exit(), because that's more obvious. >> * Likewise, don't error_setg(&error_abort, ...), use assert(). >> */ >> #define error_setg(errp, fmt, ...) \ > ... Doesn't this series then contradict this comment? Cheers, Lluis