qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 7/7] qapi: Fix array first used in a different m


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH 7/7] qapi: Fix array first used in a different module
Date: Fri, 1 Mar 2019 10:25:07 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.0

On 3/1/19 9:40 AM, Markus Armbruster wrote:
> We generally put implicitly defined types in whatever module triggered
> their definition.  This is wrong for array types, as the included test
> case demonstrates.  Let's have a closer look at it.
> 
> Type 'Status' is defined sub-sub-module.json.  Array type ['Status']
> occurs in main module qapi-schema-test.json and in
> include/sub-module.json.  The main module's use is first, so the array
> type gets put into the main module.
> 
> The generated C headers define StatusList in qapi-types.h.  But
> include/qapi-types-sub-module.h uses it without including
> qapi-types.h.  Oops.
> 
> To fix that, put the array type into its element type's module.
> 
> Now StatusList gets generated into qapi-types-sub-module.h, which all
> its users include.
> 
> Signed-off-by: Markus Armbruster <address@hidden>
> ---

Yay! One less hack in .qapi files where we had to use dummy structs to
work around awkward declaration locations.

Reviewed-by: Eric Blake <address@hidden>

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org



reply via email to

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