qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v10 12/25] qapi-visit: Kill unused visit_end_uni


From: Markus Armbruster
Subject: Re: [Qemu-devel] [PATCH v10 12/25] qapi-visit: Kill unused visit_end_union()
Date: Mon, 01 Feb 2016 13:38:23 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Eric Blake <address@hidden> writes:

> The generated code can call visit_end_union() without having called
> visit_start_union().  Example:
>
>         if (!*obj) {
>             goto out_obj;
>         }
>         visit_type_CpuInfoBase_fields(v, (CpuInfoBase **)obj, &err);
>         if (err) {
>             goto out_obj; // if we go from here...
>         }
>         if (!visit_start_union(v, !!(*obj)->u.data, &err) || err) {
>             goto out_obj;
>         }
>         switch ((*obj)->arch) {
>     [...]
>         }
>     out_obj:
>         // ... then *obj is true, and ...
>         error_propagate(errp, err);
>         err = NULL;
>         if (*obj) {
>             // we end up here
>             visit_end_union(v, !!(*obj)->u.data, &err);
>         }
>         error_propagate(errp, err);
>
> Harmless only because no visitor implements end_union().  Clean it up
> anyway, by deleting the function as useless.

This creates an asymmetry between this and the other start_*()s. but
it's only temporary: start_union() will go away in "qapi: Rework
deallocation of partial struct" (not in this series).  Okay.

> Messed up since we have visit_end_union (commit cee2ded).
>
> Signed-off-by: Markus Armbruster <address@hidden>
> Message-Id: <address@hidden>
> [expand scope of patch to delete rather than repair]
> Signed-off-by: Eric Blake <address@hidden>
>
> ---
> v10: new patch; take Markus' commit message as a starting point (hence
> his S-o-b), but rewrite the patch and claim ownership

Patch looks good.



reply via email to

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