From 565f65d271984a32eed2c324ff6ef8be33f7f3d2 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Thu, 12 Feb 2015 13:55:05 +0100 Subject: error: Use error_report_err() where appropriate Coccinelle semantic patch: @@ expression E; @@ - error_report("%s", error_get_pretty(E)); - error_free(E); + error_report_err(E); @@ expression E, S; @@ - error_report("%s", error_get_pretty(E)); + error_report_err(E); ( exit(S); | abort(); ) Trivial manual touch-ups in block/sheepdog.c. Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake --- util/qemu-config.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'util/qemu-config.c') diff --git a/util/qemu-config.c b/util/qemu-config.c index ba375c0..b13efe2 100644 --- a/util/qemu-config.c +++ b/util/qemu-config.c @@ -32,8 +32,7 @@ QemuOptsList *qemu_find_opts(const char *group) ret = find_list(vm_config_groups, group, &local_err); if (local_err) { - error_report("%s", error_get_pretty(local_err)); - error_free(local_err); + error_report_err(local_err); } return ret; @@ -314,8 +313,7 @@ int qemu_config_parse(FILE *fp, QemuOptsList **lists, const char *fname) /* group with id */ list = find_list(lists, group, &local_err); if (local_err) { - error_report("%s", error_get_pretty(local_err)); - error_free(local_err); + error_report_err(local_err); goto out; } opts = qemu_opts_create(list, id, 1, NULL); @@ -325,8 +323,7 @@ int qemu_config_parse(FILE *fp, QemuOptsList **lists, const char *fname) /* group without id */ list = find_list(lists, group, &local_err); if (local_err) { - error_report("%s", error_get_pretty(local_err)); - error_free(local_err); + error_report_err(local_err); goto out; } opts = qemu_opts_create(list, NULL, 0, &error_abort); -- cgit v1.1