From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51393) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bhdD1-0000Xd-WB for qemu-devel@nongnu.org; Wed, 07 Sep 2016 09:48:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bhdCx-0001bx-32 for qemu-devel@nongnu.org; Wed, 07 Sep 2016 09:48:11 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42420) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bhdCw-0001bl-TJ for qemu-devel@nongnu.org; Wed, 07 Sep 2016 09:48:07 -0400 From: Markus Armbruster References: <1473228390-18669-1-git-send-email-peterx@redhat.com> <87bn00ysg0.fsf@linaro.org> <20160907093308.GA5775@lemon> <87fupbyjc5.fsf@fimbulvetr.bsc.es> Date: Wed, 07 Sep 2016 15:48:02 +0200 In-Reply-To: <87fupbyjc5.fsf@fimbulvetr.bsc.es> (=?utf-8?Q?=22Llu=C3=ADs?= Vilanova"'s message of "Wed, 07 Sep 2016 14:39:54 +0200") Message-ID: <87y433bz3h.fsf@dusky.pond.sub.org> 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 Llu=C3=ADs Vilanova writes: > 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? Yes, but I asked Peter for it: Regarding error_report_abort(): in my opinion, printing pretty messages right before abort() is largely a waste of time. But if people insist on doing it, then the error subsystem may have to support it. Would you be willing to track down such usage, so we can make an informed decision? http://lists.gnu.org/archive/html/qemu-devel/2016-08/msg02930.html