From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52342) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bjJs3-0005K5-KO for qemu-devel@nongnu.org; Mon, 12 Sep 2016 01:33:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bjJrz-0005Oj-GP for qemu-devel@nongnu.org; Mon, 12 Sep 2016 01:33:31 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36278) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bjJrz-0005OV-B8 for qemu-devel@nongnu.org; Mon, 12 Sep 2016 01:33:27 -0400 Date: Mon, 12 Sep 2016 13:33:22 +0800 From: Peter Xu Message-ID: <20160912053322.GC3776@pxdev.xzpeter.org> References: <1473228390-18669-1-git-send-email-peterx@redhat.com> <87inu5m2bj.fsf@dusky.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <87inu5m2bj.fsf@dusky.pond.sub.org> 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: Markus Armbruster Cc: qemu-devel@nongnu.org, peter.maydell@linaro.org, famz@redhat.com, pbonzini@redhat.com On Fri, Sep 09, 2016 at 07:05:04PM +0200, Markus Armbruster wrote: [...] > You effectively propose to revise this coding rule from error.h: > > * 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(). > > If we accept your proposal, you get to add a patch to update the rule :) Yep, I was planning to add it in a newer version when needed, or post it seperately after this series. [...] > * Shall we fuse error_report() and exit() into error_report_fatal()? > > Saves ~200 lines, not counting the Coccinelle semantic patch. > > I think the real question is what's easier to read and to write. Do > you prefer something like > > error_report("ISA bus not available for %s", c->name); > exit(1); > > or something like > > error_report_fatal("ISA bus not available for %s", > c->name); > > The second form saves a tiny bit of instruction space, I guess. For this one, actually that's why I wrote this patchset. However, it does not mean that I think we should have it. I was just trying to post this out, to see which one we would like better. For me, error_report() with an exit() is good enough. So, if we are obviously liking it, I am willing to continue maintain this series until it's merged. Otherwise, I am still okay to put this series aside if we do not have a very strong motivation to do the change. :) Thanks for reviewing! -- peterx