提交 702832b8 编写于 作者: M Markus Armbruster

vl: Clean up error reporting in machine_set_property()

Calling error_report() in a function that takes an Error ** argument
is suspicious.  machine_set_property() 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: NMarkus Armbruster <armbru@redhat.com>
Reviewed-by: NPhilippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20181017082702.5581-22-armbru@redhat.com>
上级 dd4af977
...@@ -2677,7 +2677,7 @@ static int machine_set_property(void *opaque, ...@@ -2677,7 +2677,7 @@ static int machine_set_property(void *opaque,
g_free(qom_name); g_free(qom_name);
if (local_err) { if (local_err) {
error_report_err(local_err); error_propagate(errp, local_err);
return -1; return -1;
} }
...@@ -4249,11 +4249,8 @@ int main(int argc, char **argv, char **envp) ...@@ -4249,11 +4249,8 @@ int main(int argc, char **argv, char **envp)
} }
machine_opts = qemu_get_machine_opts(); machine_opts = qemu_get_machine_opts();
if (qemu_opt_foreach(machine_opts, machine_set_property, current_machine, qemu_opt_foreach(machine_opts, machine_set_property, current_machine,
NULL)) { &error_fatal);
object_unref(OBJECT(current_machine));
exit(1);
}
configure_accelerator(current_machine); configure_accelerator(current_machine);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册