[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v7 28/31] qapi: Split visit_end_struct() into pi
From: |
David Gibson |
Subject: |
Re: [Qemu-devel] [PATCH v7 28/31] qapi: Split visit_end_struct() into pieces |
Date: |
Tue, 8 Dec 2015 15:42:10 +1100 |
User-agent: |
Mutt/1.5.24 (2015-08-30) |
On Mon, Dec 07, 2015 at 08:55:18PM -0700, Eric Blake wrote:
> As mentioned in previous patches, we want to call visit_end_struct()
> functions unconditionally, so that visitors can release resources
> tied up since the matching visit_start_struct() without also having
> to worry about error priority if more than one error occurs.
>
> Even though error_propagate() can be safely used to ignore a second
> error during cleanup caused by a first error, it is simpler if the
> cleanup cannot set an error, and we instead split the task of
> checking that an input visitor has no unvisited input as a new
> function visit_check_struct(), called only if all prior steps are
> successful.
>
> Generated code has diffs resembling:
>
> |@@ -59,10 +59,12 @@ void visit_type_ACPIOSTInfo(Visitor *v,
> | goto out_obj;
> | }
> | visit_type_ACPIOSTInfo_fields(v, obj, &err);
> |+ if (err) {
> |+ goto out_obj;
> |+ }
> |+ visit_check_struct(v, &err);
> | out_obj:
> |- error_propagate(errp, err);
> |- err = NULL;
> |- visit_end_struct(v, &err);
> |+ visit_end_struct(v);
> | out:
>
> Signed-off-by: Eric Blake <address@hidden>
For spapr parts:
Acked-by: David Gibson <address@hidden>
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
signature.asc
Description: PGP signature
- Re: [Qemu-devel] [PATCH v7 20/31] spapr_drc: Expose 'null' in qom-get when there is no fdt, (continued)
- [Qemu-devel] [PATCH v7 24/31] qapi: Eliminate empty visit_type_FOO_fields, Eric Blake, 2015/12/07
- [Qemu-devel] [PATCH v7 19/31] qmp: Tighten output visitor rules, Eric Blake, 2015/12/07
- [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
- Re: [Qemu-devel] [PATCH v7 28/31] qapi: Split visit_end_struct() into pieces,
David Gibson <=
- [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