Hi

On Fri, Oct 23, 2020 at 2:40 PM Marc-André Lureau <
marcandre.lur...@gmail.com> wrote:

> Hi
>
> On Fri, Oct 23, 2020 at 2:14 PM Kevin Wolf <kw...@redhat.com> wrote:
>
>> Variants of simple unions are always contained in a wrapper object
>> called 'data' that serves no real use. When mapping a QAPI object to the
>> command line, this becomes very visible to users because they have to
>> add one or more useless 'data.' to many option names.
>>
>> As a first step towards avoiding this painful CLI experience, this gets
>> rid of the 'data' indirection internally: The QAPI parser doesn't use a
>> wrapper object as the variant type any more, so the indirection is
>> removed from the generated C types. As a result, the C type looks the
>> same for flat and simple unions now. A large part of this patch is
>> mechanical conversion of C code to remove the 'data' indirection.
>>
>> Conceptually, the important change is that variants can now have flat
>> and wrapped representations. For a transitioning period, we'll allow
>> variants to support both representations in a later patch. Eventually,
>> the plan is to deprecate and remove wrapped representations entirely,
>> unifying simple and flat unions.
>>
>> The externally visible interfaces stay unchanged: Visitors still expect
>> the 'data' wrappers, and introspection still shows it.
>>
>> Signed-off-by: Kevin Wolf <kw...@redhat.com>
>>
>
> breaks the build for me:
>
>
Other than that, I like the change, and it looks quite straightforward. I
hope it's acceptable and we are not missing the reasons that extra data
indirection was necessary.

Having to support both flat and wrapped versions in the externally visible
interfaces might be tricky though.

-- 
Marc-André Lureau

Reply via email to