[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 19/31] vl: Clean up error reporting in parse_add_fd(
From: |
Markus Armbruster |
Subject: |
[Qemu-devel] [PATCH 19/31] vl: Clean up error reporting in parse_add_fd() |
Date: |
Mon, 8 Oct 2018 19:31:13 +0200 |
Calling error_report() in a function that takes an Error ** argument
is suspicious. chardev_init_func() does that, and then fails without
setting an error. Its caller main(), via qemu_opts_foreach(), is fine
with it, but clean it up anyway.
Signed-off-by: Markus Armbruster <address@hidden>
---
vl.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/vl.c b/vl.c
index b8576f8f10..ecb70f87d8 100644
--- a/vl.c
+++ b/vl.c
@@ -2239,7 +2239,7 @@ static int chardev_init_func(void *opaque, QemuOpts
*opts, Error **errp)
if (!qemu_chr_new_from_opts(opts, &local_err)) {
if (local_err) {
- error_report_err(local_err);
+ error_propagate(errp, local_err);
return -1;
}
exit(0);
@@ -4185,10 +4185,8 @@ int main(int argc, char **argv, char **envp)
user_creatable_add_opts_foreach,
object_create_initial, &error_fatal);
- if (qemu_opts_foreach(qemu_find_opts("chardev"),
- chardev_init_func, NULL, NULL)) {
- exit(1);
- }
+ qemu_opts_foreach(qemu_find_opts("chardev"),
+ chardev_init_func, NULL, &error_fatal);
#ifdef CONFIG_VIRTFS
if (qemu_opts_foreach(qemu_find_opts("fsdev"),
--
2.17.1
- Re: [Qemu-devel] [PATCH 01/31] Use error_fatal to simplify obvious fatal errors (again), (continued)
- [Qemu-devel] [PATCH 05/31] vfio: Clean up error reporting after previous commit, Markus Armbruster, 2018/10/08
- [Qemu-devel] [PATCH 04/31] vfio: Use warn_report() & friends to report warnings, Markus Armbruster, 2018/10/08
- [Qemu-devel] [PATCH 20/31] vl: Clean up error reporting in machine_set_property(), Markus Armbruster, 2018/10/08
- [Qemu-devel] [PATCH 19/31] vl: Clean up error reporting in parse_add_fd(),
Markus Armbruster <=
- [Qemu-devel] [PATCH 12/31] l2tpv3: Improve -netdev/netdev_add/-net/... error reporting, Markus Armbruster, 2018/10/08
- [Qemu-devel] [PATCH 16/31] seccomp: Clean up error reporting in parse_sandbox(), Markus Armbruster, 2018/10/08