mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 15:53:54 -06:00
fsdev: Clean up error reporting in qemu_fsdev_add()
Calling error_report() from within a function that takes an Error ** argument is suspicious. qemu_fsdev_add() does that, and its caller fsdev_init_func() then fails without setting an error. Its caller main(), via qemu_opts_foreach(), is fine with it, but clean it up anyway. Cc: Greg Kurz <groug@kaod.org> Signed-off-by: Markus Armbruster <armbru@redhat.com> Acked-by: Greg Kurz <groug@kaod.org> Message-Id: <20181017082702.5581-32-armbru@redhat.com>
This commit is contained in:
parent
9338570b7b
commit
b836723dfe
5 changed files with 16 additions and 15 deletions
8
vl.c
8
vl.c
|
@ -2249,7 +2249,7 @@ static int chardev_init_func(void *opaque, QemuOpts *opts, Error **errp)
|
|||
#ifdef CONFIG_VIRTFS
|
||||
static int fsdev_init_func(void *opaque, QemuOpts *opts, Error **errp)
|
||||
{
|
||||
return qemu_fsdev_add(opts);
|
||||
return qemu_fsdev_add(opts, errp);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -4236,10 +4236,8 @@ int main(int argc, char **argv, char **envp)
|
|||
chardev_init_func, NULL, &error_fatal);
|
||||
|
||||
#ifdef CONFIG_VIRTFS
|
||||
if (qemu_opts_foreach(qemu_find_opts("fsdev"),
|
||||
fsdev_init_func, NULL, NULL)) {
|
||||
exit(1);
|
||||
}
|
||||
qemu_opts_foreach(qemu_find_opts("fsdev"),
|
||||
fsdev_init_func, NULL, &error_fatal);
|
||||
#endif
|
||||
|
||||
if (qemu_opts_foreach(qemu_find_opts("device"),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue