qemu-ppc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-ppc] [Qemu-devel] [PATCH v8 32/35] qapi: Split visit_end_struc


From: Marc-André Lureau
Subject: Re: [Qemu-ppc] [Qemu-devel] [PATCH v8 32/35] qapi: Split visit_end_struct() into pieces
Date: Tue, 5 Jan 2016 18:22:44 +0100

Hi

On Mon, Dec 21, 2015 at 6:08 PM, Eric Blake <address@hidden> 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>
>

Reviewed-by: Marc-André Lureau <address@hidden>

-- 
Marc-André Lureau



reply via email to

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