From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49056) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bhZEJ-0007Xh-Cf for qemu-devel@nongnu.org; Wed, 07 Sep 2016 05:33:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bhZEE-0002CW-Ux for qemu-devel@nongnu.org; Wed, 07 Sep 2016 05:33:14 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49908) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bhZEE-0002CS-Pq for qemu-devel@nongnu.org; Wed, 07 Sep 2016 05:33:10 -0400 Date: Wed, 7 Sep 2016 17:33:08 +0800 From: Fam Zheng Message-ID: <20160907093308.GA5775@lemon> References: <1473228390-18669-1-git-send-email-peterx@redhat.com> <87bn00ysg0.fsf@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <87bn00ysg0.fsf@linaro.org> 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: Alex =?iso-8859-1?Q?Benn=E9e?= Cc: Peter Xu , qemu-devel@nongnu.org, peter.maydell@linaro.org, armbru@redhat.com, pbonzini@redhat.com On Wed, 09/07 10:23, Alex Benn=E9e 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 shoul= d > 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, ...) \ ... Fam