qemu-e2k/scripts
Markus Armbruster 252dc3105f qapi: Generate separate .h, .c for each module
Our qapi-schema.json is composed of modules connected by include
directives, but the generated code is monolithic all the same: one
qapi-types.h with all the types, one qapi-visit.h with all the
visitors, and so forth.  These monolithic headers get included all
over the place.  In my "build everything" tree, adding a QAPI type
recompiles about 4800 out of 5100 objects.

We wouldn't write such monolithic headers by hand.  It stands to
reason that we shouldn't generate them, either.

Split up generated qapi-types.h to mirror the schema's modular
structure: one header per module.  Name the main module's header
qapi-types.h, and sub-module D/B.json's header D/qapi-types-B.h.

Mirror the schema's includes in the headers, so that qapi-types.h gets
you everything exactly as before.  If you need less, you can include
one or more of the sub-module headers.  To be exploited shortly.

Split up qapi-types.c, qapi-visit.h, qapi-visit.c, qmp-commands.h,
qmp-commands.c, qapi-event.h, qapi-event.c the same way.
qmp-introspect.h, qmp-introspect.c and qapi.texi remain monolithic.

The split of qmp-commands.c duplicates static helper function
qmp_marshal_output_str() in qapi-commands-char.c and
qapi-commands-misc.c.  This happens when commands returning the same
type occur in multiple modules.  Not worth avoiding.

Since I'm going to rename qapi-event.[ch] to qapi-events.[ch], and
qmp-commands.[ch] to qapi-commands.[ch], name the shards that way
already, to reduce churn.  This requires temporary hacks in
commands.py and events.py.  Similarly, c_name() must temporarily
be taught to munge '/' in common.py.  They'll go away with the rename.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20180211093607.27351-23-armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
[eblake: declare a dummy variable in each .c file, to shut up OSX
toolchain warnings about empty .o files, including hacking c_name()]
Signed-off-by: Eric Blake <eblake@redhat.com>
2018-03-02 13:44:24 -06:00
..
coccinelle target/*helper: don't check retaddr before calling cpu_restore_state 2017-12-27 17:20:44 -08:00
kvm vmxcap: update for September 2016 SDM 2017-03-03 16:40:02 +01:00
modules scripts: Allow block module to not define BlockDriver 2016-10-07 14:14:06 +02:00
qapi qapi: Generate separate .h, .c for each module 2018-03-02 13:44:24 -06:00
qemu-guest-agent qemu-ga: sample fsfreeze hooks 2013-01-08 16:38:12 -06:00
qemugdb scripts/qemu-gdb/timers.py: define encoding in header comment 2018-02-05 13:54:39 +01:00
qmp Use HTTPS for qemu.org and other domains 2017-11-21 13:34:13 +00:00
tracetool tracetool: For ust trace bool type as ctf_integer 2018-02-19 13:09:44 +00:00
analyse-9p-simpletrace.py scripts/analyse-9p-simpletrace.py: Add symbolic names for 9p operations. 2011-12-21 12:37:23 +05:30
analyse-locks-simpletrace.py scripts/analyse-locks-simpletrace.py: script to analyse lock times 2018-01-16 14:54:52 +01:00
analyze-inclusions Move target-* CPU file into a target/ folder 2016-12-20 21:52:12 +01:00
analyze-migration.py migration: fix analyze-migration.py script with radix table 2018-01-15 12:47:58 +01:00
archive-source.sh ui: add keycodemapdb repository as a GIT submodule 2017-10-16 14:50:54 +02:00
argparse.py scripts/argparse.py: spelling (independant) 2018-02-10 10:03:39 +03:00
check-qerror.sh qerror: add check-qerror.sh to verify alphabetical order 2012-01-18 10:23:39 -02:00
checkpatch.pl configure: add dependency 2018-01-22 14:02:33 +00:00
clean-header-guards.pl scripts: Switch to more portable Perl shebang 2017-05-10 10:19:24 +03:00
clean-includes scripts/clean-includes: added duplicate #include check 2016-10-28 18:17:23 +03:00
cleanup-trace-events.pl scripts: Switch to more portable Perl shebang 2017-05-10 10:19:24 +03:00
cocci-macro-file.h coccinelle: add g_assert_cmp* to macro file 2016-05-23 16:53:46 +02:00
coverity-model.c coverity-model: model address_space_read/write 2017-03-15 13:59:16 +01:00
create_config Add --firmwarepath to configure 2017-09-26 13:05:32 +02:00
decodetree.py decodetree: Propagate return value from translate subroutines 2018-03-02 11:03:45 +00:00
device-crash-test scripts: Remove fixed entries from the device-crash-test 2018-01-19 11:18:51 -02:00
disas-objdump.pl scripts: Switch to more portable Perl shebang 2017-05-10 10:19:24 +03:00
dump-guest-memory.py dump-guest-memory.py: skip vmcoreinfo section if not available 2018-02-01 12:13:52 +01:00
extract-vsssdk-headers Add a script to extract VSS SDK headers on POSIX system 2013-09-09 14:17:56 -05:00
feature_to_c.sh scripts: Use $(..) instead of deprecated `..` 2016-06-07 18:19:23 +03:00
get_maintainer.pl Use qemu.org domain name 2017-11-21 13:34:13 +00:00
git-submodule.sh build: fix typo in error message 2018-02-10 10:17:06 +03:00
git.orderfile add scripts/git.orderfile 2017-07-20 09:56:41 +02:00
gtester-cat test makefile overhaul 2012-03-30 08:14:11 -05:00
hxtool qemu-options: Remove stray colons from output of --help 2017-12-20 09:04:27 +01:00
make-release scripts/make-release: Don't archive .git files 2018-02-10 10:11:20 +03:00
make_device_config.sh scripts: Use $(..) instead of deprecated `..` 2016-06-07 18:19:23 +03:00
ordereddict.py qapi: Clean up qapi.py per pep8 2015-10-12 18:44:54 +02:00
qapi-gen.py qapi: Lift error reporting from QAPISchema.__init__() to callers 2018-03-02 13:14:09 -06:00
qemu-binfmt-conf.sh linux-user: Activate armeb handler registration 2018-01-11 13:25:33 +00:00
qemu-gdb.py scripts/qemu-gdb/timers.py: new helper to dump timer state 2018-01-16 14:54:51 +01:00
qemu.py qemu.py: don't launch again before shutdown() 2018-02-05 19:53:55 -02:00
qtest.py qtest.py: Few pylint/style fixes 2017-09-15 20:12:00 -03:00
refresh-pxe-roms.sh roms: rewrite scripts/refresh-pxe-roms.sh 2013-09-30 09:44:35 +02:00
shaderinclude.pl scripts: Switch to more portable Perl shebang 2017-05-10 10:19:24 +03:00
show-fixed-bugs.sh scripts: Add a script to check for bug URLs in the git log 2016-09-22 20:20:53 +02:00
signrom.py scripts: ensure signrom treats data as bytes 2018-02-05 19:53:54 -02:00
simpletrace.py simpletrace: fix flight recorder --no-header option 2017-08-15 12:50:29 +01:00
switch-timer-api scripts: Switch to more portable Perl shebang 2017-05-10 10:19:24 +03:00
texi2pod.pl scripts: Switch to more portable Perl shebang 2017-05-10 10:19:24 +03:00
tracetool.py trace: switch to modular code generation for sub-directories 2017-01-31 17:11:18 +00:00
update-linux-headers.sh scripts/update-linux-headers: import pvrdma headers 2018-02-19 13:03:24 +02:00
vmstate-static-checker.py vmstate-static-checker: update white list with spapr_pci 2017-02-28 11:30:22 +00:00