]> git.proxmox.com Git - mirror_qemu.git/commitdiff
util/error: do not free error on error_abort
authorVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Mon, 15 Apr 2019 14:25:19 +0000 (17:25 +0300)
committerMarkus Armbruster <armbru@redhat.com>
Wed, 17 Apr 2019 17:15:39 +0000 (19:15 +0200)
It would be nice to have Error object not freed away when debugging a
coredump.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20190415142519.73060-1-vsementsov@virtuozzo.com>
[error_printf_unless_qmp() replaced by error_printf()]
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
util/error.c

index 712b4d4b5dc8c54df2b4c038efed93b0f771d549..ea6d1a3d7ef55e9f4644f1f916bd6fc147e5c1ca 100644 (file)
@@ -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) {