summaryrefslogtreecommitdiff
path: root/vl.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2015-02-26 07:01:08 +0000
committerPeter Maydell <peter.maydell@linaro.org>2015-02-26 07:01:08 +0000
commitc5c6d7f81a6950d8e32a3b5a0bafd37bfa5a8e88 (patch)
tree792ffe6fdc9cfdc48c25f2da39b3a6877576eb16 /vl.c
parent68b459eaa660be17d3547aa581502fe2c572c84f (diff)
parent33394884060b6501ef39b124eeaa111f61c59f7f (diff)
Merge remote-tracking branch 'remotes/armbru/tags/pull-error-2015-02-18' into staging
Clean up around error_get_pretty(), qerror_report_err() # gpg: Signature made Wed Feb 18 10:10:07 2015 GMT using RSA key ID EB918653 # gpg: Good signature from "Markus Armbruster <armbru@redhat.com>" # gpg: aka "Markus Armbruster <armbru@pond.sub.org>" * remotes/armbru/tags/pull-error-2015-02-18: qemu-char: Avoid qerror_report_err() outside QMP command handlers qemu-img: Avoid qerror_report_err() outside QMP command handlers vl: Avoid qerror_report_err() outside QMP command handlers tpm: Avoid qerror_report_err() outside QMP command handlers numa: Avoid qerror_report_err() outside QMP command handlers net: Avoid qerror_report_err() outside QMP command handlers monitor: Avoid qerror_report_err() outside QMP command handlers monitor: Clean up around monitor_handle_fd_param() error: Use error_report_err() where appropriate error: New convenience function error_report_err() vhost-scsi: Improve error reporting for invalid vhostfd Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'vl.c')
-rw-r--r--vl.c21
1 files changed, 8 insertions, 13 deletions
diff --git a/vl.c b/vl.c
index 7e6e93c9f0..e1ffd0a96a 100644
--- a/vl.c
+++ b/vl.c
@@ -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);
@@ -2583,8 +2581,7 @@ static int machine_set_property(const char *name, const char *value,
g_free(qom_name);
if (local_err) {
- qerror_report_err(local_err);
- error_free(local_err);
+ error_report_err(local_err);
return -1;
}
@@ -2637,8 +2634,7 @@ out:
g_free(type);
g_free(dummy);
if (err) {
- qerror_report_err(err);
- error_free(err);
+ error_report_err(err);
return -1;
}
return 0;
@@ -3766,7 +3762,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 +4029,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 +4051,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 +4061,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);