[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC PATCH 14/32] qapi: Rework generated code for built
From: |
Markus Armbruster |
Subject: |
Re: [Qemu-devel] [RFC PATCH 14/32] qapi: Rework generated code for built-in types |
Date: |
Thu, 05 Oct 2017 06:24:01 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) |
Marc-André Lureau <address@hidden> writes:
> Hi
>
> On Mon, Oct 2, 2017 at 5:25 PM, Markus Armbruster <address@hidden> wrote:
>> qapi-types.py and qapi-visit.py generate some C code for built-in
>> types. To make this work with multiple schemas, we generate code for
>> built-ins into .c files only when the user asks for it with -b. The
>> user is responsible for linking exactly one set of files generated
>> with -b per program. We generate code for built-ins into .h
>> regardless of -b, but guard it with a preprocessor symbol.
>>
>> This is cumbersome and inflexible. Move the code generated for
>> built-in types into separate files builtin-qapi-{types,visit}.{c,h}.
>> Run qapi-types.py and qapi-visit.py without a schema argument to
>> generate them. Drop their option -b.
>>
>> Signed-off-by: Markus Armbruster <address@hidden>
>
>
> Good idea!
> I think I would still prefer to see a seperate argument to generate
> builtin files (rather than absence of schema), but this is minor
> detail.
An option to generate built-ins would have to conflict with -p and the
positional argument. I tried the stupidest solution that could possibly
work first.
> Reviewed-by: Marc-André Lureau <address@hidden>
Thanks!
- Re: [Qemu-devel] [RFC PATCH 11/32] qapi: Drop the options to generate only .c or .h, (continued)
- [Qemu-devel] [RFC PATCH 07/32] qapi: Drop superfluous allow_optional=True, Markus Armbruster, 2017/10/02
- [Qemu-devel] [RFC PATCH 03/32] qapi2texi: Fix for examples containing '@', Markus Armbruster, 2017/10/02
- [Qemu-devel] [RFC PATCH 26/32] qapi2texi: Include command line options information, Markus Armbruster, 2017/10/02
- [Qemu-devel] [RFC PATCH 27/32] os-posix: Drop misleading comment, Markus Armbruster, 2017/10/02
- [Qemu-devel] [RFC PATCH 14/32] qapi: Rework generated code for built-in types, Markus Armbruster, 2017/10/02
- [Qemu-devel] [RFC PATCH 28/32] vl: QAPIfy command line option definition, Markus Armbruster, 2017/10/02