[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC 00/15] Error API: Flag errors in *errp even if err
From: |
Eduardo Habkost |
Subject: |
Re: [Qemu-devel] [RFC 00/15] Error API: Flag errors in *errp even if errors are being ignored |
Date: |
Sat, 1 Jul 2017 11:29:09 -0300 |
User-agent: |
Mutt/1.8.0 (2017-02-23) |
On Fri, Jun 30, 2017 at 01:40:58PM +0200, Markus Armbruster wrote:
[...]
>
> I doubt the macros make the bug fixing materially easier, and I doubt
> they can reduce future bugs of this kind. What they can do is letting
> us get rid of error_propagate() boilerplate with relative ease.
>
> If we switch to returning success/failure (which also gets rid of the
> boilerplate), then the macros may still let us get rid of boilerplate
> more quickly, for some additional churn. Worthwhile? Depends on how
> long the return value change takes us.
>
> I think the first order of business is to figure out whether we want to
> pursue returning success/failure.
About this, I'm unsure. Returning error information in two separate
locations (the return value and *errp) makes it easier to introduce bugs
that are hard to detect. Especially when the tree is an inconsistent
state where we mix -1/0, -errno/0, FALSE/TRUE, NULL/non-NULL and void
functions.
--
Eduardo