diff options
Diffstat (limited to 'fsdev')
-rw-r--r-- | fsdev/qemu-fsdev-dummy.c | 2 | ||||
-rw-r--r-- | fsdev/qemu-fsdev.c | 12 | ||||
-rw-r--r-- | fsdev/qemu-fsdev.h | 2 |
3 files changed, 7 insertions, 9 deletions
diff --git a/fsdev/qemu-fsdev-dummy.c b/fsdev/qemu-fsdev-dummy.c index 6dc0fbc4c4..489cd29081 100644 --- a/fsdev/qemu-fsdev-dummy.c +++ b/fsdev/qemu-fsdev-dummy.c @@ -15,7 +15,7 @@ #include "qemu/config-file.h" #include "qemu/module.h" -int qemu_fsdev_add(QemuOpts *opts) +int qemu_fsdev_add(QemuOpts *opts, Error **errp) { return 0; } diff --git a/fsdev/qemu-fsdev.c b/fsdev/qemu-fsdev.c index 8a4afbffbd..7a3b87cc9e 100644 --- a/fsdev/qemu-fsdev.c +++ b/fsdev/qemu-fsdev.c @@ -30,7 +30,7 @@ static FsDriverTable FsDrivers[] = { { .name = "proxy", .ops = &proxy_ops}, }; -int qemu_fsdev_add(QemuOpts *opts) +int qemu_fsdev_add(QemuOpts *opts, Error **errp) { int i; struct FsDriverListEntry *fsle; @@ -38,10 +38,9 @@ int qemu_fsdev_add(QemuOpts *opts) const char *fsdriver = qemu_opt_get(opts, "fsdriver"); const char *writeout = qemu_opt_get(opts, "writeout"); bool ro = qemu_opt_get_bool(opts, "readonly", 0); - Error *local_err = NULL; if (!fsdev_id) { - error_report("fsdev: No id specified"); + error_setg(errp, "fsdev: No id specified"); return -1; } @@ -53,11 +52,11 @@ int qemu_fsdev_add(QemuOpts *opts) } if (i == ARRAY_SIZE(FsDrivers)) { - error_report("fsdev: fsdriver %s not found", fsdriver); + error_setg(errp, "fsdev: fsdriver %s not found", fsdriver); return -1; } } else { - error_report("fsdev: No fsdriver specified"); + error_setg(errp, "fsdev: No fsdriver specified"); return -1; } @@ -76,8 +75,7 @@ int qemu_fsdev_add(QemuOpts *opts) } if (fsle->fse.ops->parse_opts) { - if (fsle->fse.ops->parse_opts(opts, &fsle->fse, &local_err)) { - error_report_err(local_err); + if (fsle->fse.ops->parse_opts(opts, &fsle->fse, errp)) { g_free(fsle->fse.fsdev_id); g_free(fsle); return -1; diff --git a/fsdev/qemu-fsdev.h b/fsdev/qemu-fsdev.h index 65e4b1cfab..d9716b4144 100644 --- a/fsdev/qemu-fsdev.h +++ b/fsdev/qemu-fsdev.h @@ -38,7 +38,7 @@ typedef struct FsDriverListEntry { QTAILQ_ENTRY(FsDriverListEntry) next; } FsDriverListEntry; -int qemu_fsdev_add(QemuOpts *opts); +int qemu_fsdev_add(QemuOpts *opts, Error **errp); FsDriverEntry *get_fsdev_fsentry(char *id); extern FileOperations local_ops; extern FileOperations handle_ops; |