From b922c0506ad557b98ded1a0c7259844738a86e78 Mon Sep 17 00:00:00 2001 From: Vladimir Sementsov-Ogievskiy Date: Mon, 15 Apr 2019 17:25:19 +0300 Subject: util/error: do not free error on error_abort It would be nice to have Error object not freed away when debugging a coredump. Signed-off-by: Vladimir Sementsov-Ogievskiy Message-Id: <20190415142519.73060-1-vsementsov@virtuozzo.com> [error_printf_unless_qmp() replaced by error_printf()] Reviewed-by: Markus Armbruster Signed-off-by: Markus Armbruster --- util/error.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'util/error.c') diff --git a/util/error.c b/util/error.c index 712b4d4b5d..ea6d1a3d7e 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("%s", err->hint->str); + } abort(); } if (errp == &error_fatal) { -- cgit v1.2.3