diff options
author | Markus Armbruster <armbru@redhat.com> | 2015-02-12 13:55:05 +0100 |
---|---|---|
committer | Markus Armbruster <armbru@redhat.com> | 2015-02-18 10:51:09 +0100 |
commit | 565f65d271984a32eed2c324ff6ef8be33f7f3d2 (patch) | |
tree | 0adbc6737d2dc268c00166eb9b9dc89caa4ea28b /vl.c | |
parent | 2ee2f1e41517efa7b5dd604a68ceca9b1377de2c (diff) |
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 <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'vl.c')
-rw-r--r-- | vl.c | 15 |
1 files changed, 6 insertions, 9 deletions
@@ -2137,8 +2137,7 @@ static int chardev_init_func(QemuOpts *opts, void *opaque) qemu_chr_new_from_opts(opts, NULL, &local_err); if (local_err) { - error_report("%s", error_get_pretty(local_err)); - error_free(local_err); + error_report_err(local_err); return -1; } return 0; @@ -2218,8 +2217,7 @@ static void monitor_parse(const char *optarg, const char *mode, bool pretty) opts = qemu_opts_create(qemu_find_opts("mon"), label, 1, &local_err); if (!opts) { - error_report("%s", error_get_pretty(local_err)); - error_free(local_err); + error_report_err(local_err); exit(1); } qemu_opt_set(opts, "mode", mode); @@ -3766,7 +3764,7 @@ int main(int argc, char **argv, char **envp) os_daemonize(); if (qemu_init_main_loop(&main_loop_err)) { - error_report("%s", error_get_pretty(main_loop_err)); + error_report_err(main_loop_err); exit(1); } @@ -4033,8 +4031,7 @@ int main(int argc, char **argv, char **envp) Error *local_err = NULL; qtest_init(qtest_chrdev, qtest_log, &local_err); if (local_err) { - error_report("%s", error_get_pretty(local_err)); - error_free(local_err); + error_report_err(local_err); exit(1); } } @@ -4056,7 +4053,7 @@ int main(int argc, char **argv, char **envp) if (order) { validate_bootdevices(order, &local_err); if (local_err) { - error_report("%s", error_get_pretty(local_err)); + error_report_err(local_err); exit(1); } boot_order = order; @@ -4066,7 +4063,7 @@ int main(int argc, char **argv, char **envp) if (once) { validate_bootdevices(once, &local_err); if (local_err) { - error_report("%s", error_get_pretty(local_err)); + error_report_err(local_err); exit(1); } normal_boot_order = g_strdup(boot_order); |