mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-26 20:03:54 -06: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:
parent
d8803b1ad0
commit
91cda4e8f3
5 changed files with 37 additions and 20 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue