[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2] util/error: do not free error on error_abort
From: |
Markus Armbruster |
Subject: |
Re: [Qemu-devel] [PATCH v2] util/error: do not free error on error_abort |
Date: |
Wed, 17 Apr 2019 19:16:52 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) |
Vladimir Sementsov-Ogievskiy <address@hidden> writes:
> It would be nice to have Error object not freed away when debugging a
> coredump.
>
> Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
> ---
>
> v2: don't change error output format
>
> util/error.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/util/error.c b/util/error.c
> index 934a78e1b1..22f8a7924f 100644
> --- a/util/error.c
> +++ b/util/error.c
> @@ -34,7 +34,10 @@ static void error_handle_fatal(Error **errp, Error *err)
> if (errp == &error_abort) {
> fprintf(stderr, "Unexpected error in %s() at %s:%d:\n",
> err->func, err->src, err->line);
> - error_report_err(err);
> + error_report("%s", error_get_pretty(err));
> + if (err->hint) {
> + error_printf_unless_qmp("%s", err->hint->str);
> + }
> abort();
> }
> if (errp == &error_fatal) {
We've since found out that the hint should be printed with
error_printf(), see "[PATCH] error: Fix error_report_err(),
warn_report_err() hint printing". With that:
Reviewed-by: Markus Armbruster <address@hidden>
Queued with this change. Thanks!