[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v4 0/4] Introduce error_report_{fatal|abort}
From: |
Peter Xu |
Subject: |
Re: [Qemu-devel] [PATCH v4 0/4] Introduce error_report_{fatal|abort} |
Date: |
Mon, 12 Sep 2016 13:33:22 +0800 |
User-agent: |
Mutt/1.5.24 (2015-08-30) |
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