diff options
author | Luiz Capitulino <lcapitulino@redhat.com> | 2012-04-12 11:58:57 -0300 |
---|---|---|
committer | Luiz Capitulino <lcapitulino@redhat.com> | 2012-06-04 13:49:34 -0300 |
commit | 299528668c759f40b2cc78914e2ca2c832f82834 (patch) | |
tree | 6c908f77a26f5315160ad391933eaf441eafdbf1 /qemu-option.c | |
parent | 6c5194046a34ff9f84e294d4ef926ec509741493 (diff) | |
download | qemu-299528668c759f40b2cc78914e2ca2c832f82834.zip qemu-299528668c759f40b2cc78914e2ca2c832f82834.tar.gz qemu-299528668c759f40b2cc78914e2ca2c832f82834.tar.bz2 |
qemu-option: qemu_opts_validate(): use error_set()
net_client_init() propagates the error up by calling qerror_report_err(),
because its users expect QError semantics.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Reviewed-By: Laszlo Ersek <lersek@redhat.com>
Diffstat (limited to 'qemu-option.c')
-rw-r--r-- | qemu-option.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/qemu-option.c b/qemu-option.c index 6d36970..eee3b45 100644 --- a/qemu-option.c +++ b/qemu-option.c @@ -1041,7 +1041,7 @@ QDict *qemu_opts_to_qdict(QemuOpts *opts, QDict *qdict) /* Validate parsed opts against descriptions where no * descriptions were provided in the QemuOptsList. */ -int qemu_opts_validate(QemuOpts *opts, const QemuOptDesc *desc) +void qemu_opts_validate(QemuOpts *opts, const QemuOptDesc *desc, Error **errp) { QemuOpt *opt; Error *local_err = NULL; @@ -1057,21 +1057,18 @@ int qemu_opts_validate(QemuOpts *opts, const QemuOptDesc *desc) } } if (desc[i].name == NULL) { - qerror_report(QERR_INVALID_PARAMETER, opt->name); - return -1; + error_set(errp, QERR_INVALID_PARAMETER, opt->name); + return; } opt->desc = &desc[i]; qemu_opt_parse(opt, &local_err); if (error_is_set(&local_err)) { - qerror_report_err(local_err); - error_free(local_err); - return -1; + error_propagate(errp, local_err); + return; } } - - return 0; } int qemu_opts_foreach(QemuOptsList *list, qemu_opts_loopfunc func, void *opaque, |