mirror of
https://github.com/mii443/qemu.git
synced 2025-08-22 23:25:48 +00:00
fsdev: improve error handling of backend opts parsing
This patch changes some error messages in the backend opts parsing code and convert backends to propagate QEMU Error objects instead of calling error_report(). Signed-off-by: Greg Kurz <groug@kaod.org>
This commit is contained in:
@ -37,6 +37,7 @@ 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");
|
||||
@ -74,7 +75,8 @@ int qemu_fsdev_add(QemuOpts *opts)
|
||||
}
|
||||
|
||||
if (fsle->fse.ops->parse_opts) {
|
||||
if (fsle->fse.ops->parse_opts(opts, &fsle->fse)) {
|
||||
if (fsle->fse.ops->parse_opts(opts, &fsle->fse, &local_err)) {
|
||||
error_report_err(local_err);
|
||||
g_free(fsle->fse.fsdev_id);
|
||||
g_free(fsle);
|
||||
return -1;
|
||||
|
Reference in New Issue
Block a user