[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: |
Markus Armbruster |
Subject: |
Re: [Qemu-devel] [PATCH] 9p: Print error hints if option parsing fails |
Date: |
Sat, 14 Sep 2019 20:59:46 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) |
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.
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().