|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH 09/14] error: Use error_setg_file_open() for simplicity and consistency
* Markus Armbruster (armbru@xxxxxxxxxx) wrote:
> "Dr. David Alan Gilbert" <dave@xxxxxxxxxxx> writes:
>
> > * Markus Armbruster (armbru@xxxxxxxxxx) wrote:
> >> Replace
> >>
> >> error_setg_errno(errp, errno, MSG, FNAME);
> >>
> >> by
> >>
> >> error_setg_file_open(errp, errno, FNAME);
> >>
> >> where MSG is "Could not open '%s'" or similar.
> >>
> >> Also replace equivalent uses of error_setg().
> >>
> >> A few messages lose prefixes ("net dump: ", "SEV: ", __func__ ": ").
> >> We could put them back with error_prepend(). Not worth the bother.
> >
> > Yeh, I guess you could just do it with another macro using
> > the same internal function just with string concatenation.
>
> I'm no fan of such prefixes. A sign of developers not caring enough to
> craft a good error message for *users*. *Especially* in the case of
> __func__.
>
> The error messages changes in question are:
>
> net dump: can't open DUMP-FILE: REASON
> Could not open 'DUMP-FILE': REASON
>
> SEV: Failed to open SEV-DEVICE: REASON
> Could not open 'SEV-DEVICE': REASON
>
> sev_common_kvm_init: Failed to open SEV_DEVICE 'REASON'
> Could not open 'SEV-DEVICE': REASON
>
> I think these are all improvements, and the loss of the prefix is fine.
Yeh, although I find the error messages aren't just for users;
they're often for the first dev to see it to guess which other
dev to pass the problem to, so a hint about where it's coming
from can be useful.
Dave
> >> Signed-off-by: Markus Armbruster <armbru@xxxxxxxxxx>
> >
> > Reviewed-by: Dr. David Alan Gilbert <dave@xxxxxxxxxxx>
>
> Thanks!
>
--
-----Open up your eyes, open up your mind, open up your code -------
/ Dr. David Alan Gilbert | Running GNU/Linux | Happy \
\ dave @ treblig.org | | In Hex /
\ _________________________|_____ http://www.treblig.org |_______/
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |