[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 7/9] QemuOpts: Drop qemu_opt_foreach() parameter
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH 7/9] QemuOpts: Drop qemu_opt_foreach() parameter abort_on_failure |
Date: |
Thu, 28 May 2015 12:57:57 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 |
On 05/28/2015 06:21 AM, Markus Armbruster wrote:
> When the argument is non-zero, qemu_opt_foreach() stops on callback
> returning non-zero, and returns that value.
>
> When the argument is zero, it doesn't stop, and returns the callback's
> value from the last iteration.
>
> The two callers that pass zero could just as well pass one:
>
> * qemu_spice_init()'s callback add_channel() either returns zero or
> exit()s.
>
> * config_write_opts()'s callback config_write_opt() always returns
> zero.
>
> Drop the parameter, and always stop.
>
> Signed-off-by: Markus Armbruster <address@hidden>
> ---
> +++ b/net/vhost-user.c
> @@ -185,7 +185,7 @@ static CharDriverState *net_vhost_parse_chardev(const
> NetdevVhostUserOptions *op
>
> /* inspect chardev opts */
> memset(&props, 0, sizeof(props));
> - if (qemu_opt_foreach(chr->opts, net_vhost_chardev_opts, &props, true) !=
> 0) {
> + if (qemu_opt_foreach(chr->opts, net_vhost_chardev_opts, &props)) {
Another case of confusion on 'int' vs. 'bool' gone. Good riddance!
Reviewed-by: Eric Blake <address@hidden>
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
- [Qemu-devel] [PATCH 0/9] Miscellaneous error reporting improvements, Markus Armbruster, 2015/05/28
- [Qemu-devel] [PATCH 1/9] vl: Report failure to sandbox at most once, Markus Armbruster, 2015/05/28
- [Qemu-devel] [PATCH 9/9] vhost-user: Improve -netdev/netdev_add/-net/... error reporting, Markus Armbruster, 2015/05/28
- [Qemu-devel] [PATCH 2/9] vl: Print -device help at most once, Markus Armbruster, 2015/05/28
- [Qemu-devel] [PATCH 7/9] QemuOpts: Drop qemu_opt_foreach() parameter abort_on_failure, Markus Armbruster, 2015/05/28
- Re: [Qemu-devel] [PATCH 7/9] QemuOpts: Drop qemu_opt_foreach() parameter abort_on_failure,
Eric Blake <=
- [Qemu-devel] [PATCH 8/9] QemuOpts: Convert qemu_opt_foreach() to Error, Markus Armbruster, 2015/05/28
- [Qemu-devel] [PATCH 3/9] vl: Fail right after first bad -object, Markus Armbruster, 2015/05/28
- [Qemu-devel] [PATCH 4/9] QemuOpts: Drop qemu_opts_foreach() parameter abort_on_failure, Markus Armbruster, 2015/05/28
- [Qemu-devel] [PATCH 5/9] QemuOpts: Convert qemu_opts_foreach() to Error, Markus Armbruster, 2015/05/28
- [Qemu-devel] [PATCH 6/9] blkdebug: Simplify passing of Error through qemu_opts_foreach(), Markus Armbruster, 2015/05/28