[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] 9p: Print error hints if option parsing fails
From: |
Greg Kurz |
Subject: |
Re: [Qemu-devel] [PATCH] 9p: Print error hints if option parsing fails |
Date: |
Sun, 15 Sep 2019 20:50:32 +0200 |
On Sat, 14 Sep 2019 20:59:46 +0200
Markus Armbruster <address@hidden> wrote:
> Greg Kurz <address@hidden> writes:
>
> > Option parsing fonctions are called with &error_fatal, which
>
> functions
>
> > causes error_setg() to call exit() and the hints are never
> > printed.
> >
> > Use an intermediate error object so that exit() happens in
> > error_propagate() after error_append_hint() could be called.
>
> Hmm.
>
> Code that creates error objects should not need to know how they are
> handled.
>
Agreed.
> Your patch shows that error_append_hint() requires error_propagate() to
> work regardless of how the error is handled. We should amend
> error_append_hint()'s contract in error.h to spell this out, and search
> the tree for more misuse of error_append_hint().
Sure. I'll take care of that.
Cheers,
--
Greg