[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v12 35/36] qapi: Simplify visits of optional fie
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH v12 35/36] qapi: Simplify visits of optional fields |
Date: |
Wed, 18 Nov 2015 13:10:15 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 |
On 11/18/2015 11:54 AM, Markus Armbruster wrote:
> Eric Blake <address@hidden> writes:
>
>> None of the visitor callbacks would set an error when testing
>> if an optional field was present; make this part of the interface
>> contract by eliminating the errp argument.
>>
>> The resulting generated code has a nice diff:
>>
>> |- visit_optional(v, &has_fdset_id, "fdset-id", &err);
>> |- if (err) {
>> |- goto out;
>> |- }
>> |- if (has_fdset_id) {
>> |+ visit_optional(v, &has_fdset_id, "fdset-id");
>> |+ if (has_fdset_id) {
>> | visit_type_int(v, &fdset_id, "fdset-id", &err);
>> | if (err) {
>> | goto out;
>> | }
>> | }
>
> I think this should be
>
> |- visit_optional(v, &has_fdset_id, "fdset-id", &err);
> |- if (err) {
> |- goto out;
> |- }
> |+ visit_optional(v, &has_fdset_id, "fdset-id");
> | if (has_fdset_id) {
Oh, yeah. Serves me right for hand-editing a diff in my commit message.
(Patch applies either diff just fine, it's just that mine was longer
than necessary).
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
- [Qemu-devel] [PATCH] fixup! qapi: Forbid case-insensitive clashes, (continued)
[Qemu-devel] [PATCH v12 35/36] qapi: Simplify visits of optional fields, Eric Blake, 2015/11/18
[Qemu-devel] [PATCH v12 33/36] qapi: Fix alternates that accept 'number' but not 'int', Eric Blake, 2015/11/18
[Qemu-devel] [PATCH v12 29/36] qobject: Rename qtype_code to QType, Eric Blake, 2015/11/18
[Qemu-devel] [PATCH v12 31/36] qapi: Simplify visiting of alternate types, Eric Blake, 2015/11/18