qemu-devel
[Top][All Lists]
Advanced

[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

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]