[Top][All Lists]

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

Re: [Qemu-devel] [PATCH RFC 17/21] qapi/types qapi/visit: Generate built

From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH RFC 17/21] qapi/types qapi/visit: Generate built-in stuff into separate files
Date: Tue, 6 Feb 2018 14:54:57 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2

On 02/02/2018 07:03 AM, Markus Armbruster wrote:
Linking code from multiple separate QAPI schemata into the same
program is possible, but involves some weirdness around built-in

* We generate code for built-in types into .c only with option
   --builtins.  The user is responsible to generate code for exactly
   one QAPI schema per program with --builtins.

* We generate code for them it into .h regardless of --builtins,

s/them it/them/

   guarded by #ifndef QAPI_VISIT_BUILTIN.  Because the code for
   built-in types is exactly the same in all of them, including any
   combination of these headers works.

Replace this contraption by something more conventional: generate code
for built-in types into their very own files: qapi-builtin-types.c,
qapi-builtin-visit.c, qapi-builtin-types.h, qapi-builtin-visit.h, but
only with --builtins.  Obey --output-dir, but ignore --prefix for

Make qapi-types.h include qapi-builtin-types.h.  With multiple
schemata you now have multiple qapi-types.[ch], but only one
qapi-builtin-types.[ch].  Same for qapi-visit.[ch] and

Bonus: if all you need is built-in stuff, you can include a much
smaller header.  To be exploited shortly.

Signed-off-by: Markus Armbruster <address@hidden>

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

reply via email to

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