qemu/docs/devel
Eric Blake 8c643361ee qapi: Add comments to aid debugging generated introspection
We consciously chose in commit 1a9a507b to hide QAPI type names
from the introspection output on the wire, but added a command
line option -u to unmask the type name when doing a debug build.
The unmask option still remains useful to some other forms of
automated analysis, so it will not be removed; however, when it
is not in use, the generated .c file can be hard to read.  At
the time when we first introduced masking, the generated file
consisted only of a monolithic C string, so there was no clean
way to inject any comments.

Later, in commit 7d0f982b, we switched the generation to output
a QLit object, in part to make it easier for future addition of
conditional compilation.  In fact, commit d626b6c1 took advantage
of this by passing a tuple instead of a bare object for encoding
the output of conditionals.  By extending that tuple, we can now
interject strategic comments.

For now, type name debug aid comments are only output once per
meta-type, rather than at all uses of the number used to encode
the type within the introspection data.  But this is still a lot
more convenient than having to regenerate the file with the
unmask operation temporarily turned on - merely search the
generated file for '"NNN" =' to learn the corresponding source
name and associated definition of type NNN.

The generated qapi-introspect.c changes only with the addition
of comments, such as:

| @@ -14755,6 +15240,7 @@
|          { "name", QLIT_QSTR("[485]"), },
|          {}
|      })),
| +    /* "485" = QCryptoBlockInfoLUKSSlot */
|      QLIT_QDICT(((QLitDictEntry[]) {
|          { "members", QLIT_QLIST(((QLitObject[]) {
|              QLIT_QDICT(((QLitDictEntry[]) {

Signed-off-by: Eric Blake <eblake@redhat.com>
Message-Id: <20180827213943.33524-3-eblake@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
[Rebased, update to qapi-code-gen.txt corrected]
Signed-off-by: Markus Armbruster <armbru@redhat.com>
2018-08-28 18:21:38 +02:00
..
atomics.txt docs: document atomic_load_acquire and atomic_store_release 2018-03-12 16:12:47 +01:00
blkdebug.txt docs: create config/, devel/ and spin/ subdirectories 2017-06-07 18:22:03 +02:00
blkverify.txt docs: create config/, devel/ and spin/ subdirectories 2017-06-07 18:22:03 +02:00
build-system.txt build-sys: add a rule to print a variable 2018-01-12 13:22:02 +01:00
loads-stores.rst bswap: Add new stn_*_p() and ldn_*_p() memory access functions 2018-06-15 15:23:34 +01:00
lockcnt.txt docs: fix broken paths to docs/devel/atomics.txt 2017-07-31 13:12:47 +03:00
memory.txt memory: get rid of memory_region_init_reservation 2018-06-01 14:15:10 +02:00
migration.rst docs/migration: Clarify pre_load in subsections 2018-08-22 11:40:47 +02:00
multi-thread-tcg.txt docs: Grammar and spelling fixes 2018-07-13 10:16:04 +01:00
multiple-iothreads.txt docs: mark nested AioContext locking as a legacy API 2017-12-19 10:25:09 +00:00
qapi-code-gen.txt qapi: Add comments to aid debugging generated introspection 2018-08-28 18:21:38 +02:00
rcu.txt docs: create config/, devel/ and spin/ subdirectories 2017-06-07 18:22:03 +02:00
stable-process.rst docs: document our stable process 2018-02-19 10:51:16 +01:00
testing.rst tests/vm: Propagate V=1 down into the make inside the VM 2018-08-15 10:12:35 +08:00
tracing.txt tracing: Use double-dash spelling for trace option 2018-07-19 13:09:04 +01:00
virtio-migration.txt docs: create config/, devel/ and spin/ subdirectories 2017-06-07 18:22:03 +02:00
writing-qmp-commands.txt qapi: Move qapi-schema.json to qapi/, rename generated files 2018-03-02 13:45:57 -06:00