[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 06/16] qemu-option: qemu_opts_validate(): use er
From: |
Laszlo Ersek |
Subject: |
Re: [Qemu-devel] [PATCH 06/16] qemu-option: qemu_opts_validate(): use error_set() |
Date: |
Fri, 18 May 2012 16:18:27 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:10.0.4) Gecko/20120422 Thunderbird/10.0.4 |
On 05/17/12 16:33, Luiz Capitulino wrote:
> @@ -1060,21 +1060,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;
> }
(I *almost* suggested to drop "local_err" and pass "errp" directly to
qemu_opt_parse(), since the "if" body consists of nothing more than
error_propagate() now. But then I noticed the "return" that aborts the
QTAILQ_FOREACH(), and so we do have to rely on "local_err" -- "errp"
could be NULL, and we could not check *errp for loop-exit purposes. Good.)
Laszlo
- [Qemu-devel] [PATCH 08/16] qemu-option: introduce qemu_opt_set_err(), (continued)
- [Qemu-devel] [PATCH 08/16] qemu-option: introduce qemu_opt_set_err(), Luiz Capitulino, 2012/05/17
- [Qemu-devel] [PATCH 04/16] qemu-option: parse_option_size(): use error_set(), Luiz Capitulino, 2012/05/17
- [Qemu-devel] [PATCH 13/16] net: purge the monitor object from all init functions, Luiz Capitulino, 2012/05/17
- [Qemu-devel] [PATCH 11/16] qemu-config: find_list(): use error_set(), Luiz Capitulino, 2012/05/17
- [Qemu-devel] [PATCH 15/16] qapi: convert netdev_add, Luiz Capitulino, 2012/05/17
- [Qemu-devel] [PATCH 16/16] qapi: convert netdev_del, Luiz Capitulino, 2012/05/17
- [Qemu-devel] [PATCH 12/16] qemu-config: introduce qemu_find_opts_err(), Luiz Capitulino, 2012/05/17
- [Qemu-devel] [PATCH 06/16] qemu-option: qemu_opts_validate(): use error_set(), Luiz Capitulino, 2012/05/17
- Re: [Qemu-devel] [PATCH 06/16] qemu-option: qemu_opts_validate(): use error_set(),
Laszlo Ersek <=
- [Qemu-devel] [PATCH 14/16] net: net_client_init(): use error_set(), Luiz Capitulino, 2012/05/17