mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 08:13: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
|
@ -14,6 +14,7 @@
|
|||
#include "hw/9pfs/9p.h"
|
||||
#include "hw/xen/xen_backend.h"
|
||||
#include "hw/9pfs/xen-9pfs.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qemu/config-file.h"
|
||||
#include "qemu/option.h"
|
||||
#include "fsdev/qemu-fsdev.h"
|
||||
|
@ -355,6 +356,7 @@ static int xen_9pfs_free(struct XenDevice *xendev)
|
|||
|
||||
static int xen_9pfs_connect(struct XenDevice *xendev)
|
||||
{
|
||||
Error *err = NULL;
|
||||
int i;
|
||||
Xen9pfsDev *xen_9pdev = container_of(xendev, Xen9pfsDev, xendev);
|
||||
V9fsState *s = &xen_9pdev->state;
|
||||
|
@ -452,7 +454,10 @@ static int xen_9pfs_connect(struct XenDevice *xendev)
|
|||
qemu_opt_set(fsdev, "path", xen_9pdev->path, NULL);
|
||||
qemu_opt_set(fsdev, "security_model", xen_9pdev->security_model, NULL);
|
||||
qemu_opts_set_id(fsdev, s->fsconf.fsdev_id);
|
||||
qemu_fsdev_add(fsdev);
|
||||
qemu_fsdev_add(fsdev, &err);
|
||||
if (err) {
|
||||
error_report_err(err);
|
||||
}
|
||||
v9fs_device_realize_common(s, &xen_9p_transport, NULL);
|
||||
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue