[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v7 29/31] qapi: Simplify semantics of visit_next
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH v7 29/31] qapi: Simplify semantics of visit_next_list() |
Date: |
Thu, 10 Dec 2015 10:32:14 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 |
On 12/07/2015 08:55 PM, Eric Blake wrote:
> We can greatly simplify things by hoisting the special case
> into the start() routine, and flipping the order in the loop
> to visit before advance:
>
> start(head)
> element = *head
> while (element) {
> visit(element)
> element = next(element)
> }
>
> +++ b/include/qapi/visitor-impl.h
> @@ -40,9 +40,10 @@ struct Visitor
> void (*end_implicit_struct)(Visitor *v);
>
> /* Must be set */
> - void (*start_list)(Visitor *v, const char *name, Error **errp);
> + void (*start_list)(Visitor *v, const char *name, GenericList **list,
> + Error **errp);
Looking at this, it is inconsistent with start_struct (where name comes
AFTER the object); that is, I think this should probably be:
void (*start_list)(Visitor *v, GenericList **list, const char *name,
Error **errp);
although I'll still wait for review comments before respinning.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
- [Qemu-devel] [PATCH v7 21/31] qapi: Simplify excess input reporting in input visitors, (continued)
- [Qemu-devel] [PATCH v7 21/31] qapi: Simplify excess input reporting in input visitors, Eric Blake, 2015/12/07
- [Qemu-devel] [PATCH v7 09/31] qapi: Prefer type_int64 over type_int in visitors, Eric Blake, 2015/12/07
- [Qemu-devel] [PATCH v7 23/31] qapi: Fix command with named empty argument type, Eric Blake, 2015/12/07
- [Qemu-devel] [PATCH v7 26/31] qapi-visit: Unify struct and union visit, Eric Blake, 2015/12/07
- [Qemu-devel] [PATCH v7 27/31] qapi: Rework deallocation of partial struct, Eric Blake, 2015/12/07
- [Qemu-devel] [PATCH v7 25/31] qapi: Canonicalize missing object to :empty, Eric Blake, 2015/12/07
- [Qemu-devel] [PATCH v7 28/31] qapi: Split visit_end_struct() into pieces, Eric Blake, 2015/12/07
- [Qemu-devel] [PATCH v7 29/31] qapi: Simplify semantics of visit_next_list(), Eric Blake, 2015/12/07
- [Qemu-devel] [PATCH v7 16/31] qmp: Don't abuse stack to track qmp-output root, Eric Blake, 2015/12/07
- [Qemu-devel] [PATCH v7 17/31] qapi: Document visitor interfaces, add assertions, Eric Blake, 2015/12/07
- [Qemu-devel] [PATCH v7 31/31] RFC: qapi: Adjust layout of FooList types, Eric Blake, 2015/12/07
- [Qemu-devel] [PATCH v7 30/31] qapi: Change visit_type_FOO() to no longer return partial objects, Eric Blake, 2015/12/07