qemu/docs/devel
Markus Armbruster 75ecee7262 qapi: Enable enum member introspection to show more than name
The next commit will add feature flags to enum members.  There's a
problem, though: query-qmp-schema shows an enum type's members as an
array of member names (SchemaInfoEnum member @values).  If it showed
an array of objects with a name member, we could simply add more
members to these objects.  Since it's just strings, we can't.

I can see three ways to correct this design mistake:

1. Do it the way we should have done it, plus compatibility goo.

   We want a ['SchemaInfoEnumMember'] member in SchemaInfoEnum.  Since
   changing @values would be a compatibility break, add a new member
   @members instead.

   @values is now redundant.  In my testing, output of
   qemu-system-x86_64's query-qmp-schema grows by 11% (18.5KiB).

   We can deprecate @values now and drop it later.  This will break
   outmoded clients.  Well-behaved clients such as libvirt are
   expected to break cleanly.

2. Like 1, but omit "boring" elements of @member, and empty @member.

   @values does not become redundant.  @members augments it.  Somewhat
   cumbersome, but output of query-qmp-schema grows only as we make
   enum members non-boring.

   There is nothing to deprecate here.

3. Versioned query-qmp-schema.

   query-qmp-schema provides either @values or @members.  The QMP
   client can select which version it wants.  There is no redundant
   output.

   We can deprecate old versions and eventually drop them.  This will
   break outmoded clients.  Breaking cleanly is easier than for 1.

   While 1 and 2 operate within the common rules for compatible
   evolution apply (section "Compatibility considerations" in
   docs/devel/qapi-code-gen.rst), 3 bypasses them.  Attractive when
   operating within the rules is just too awkward.  Not the case here.

This commit implements 1.  Libvirt developers prefer it.

Deprecate @values in favour of @members.  Since query-qmp-schema
compatibility is pretty fundamental for management applications, an
extended grace period is advised.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Tested-by: Peter Krempa <pkrempa@redhat.com>
Acked-by: Peter Krempa <pkrempa@redhat.com>
Message-Id: <20211025042405.3762351-2-armbru@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
2021-10-27 17:18:43 +02:00
..
atomics.rst qemu/atomic.h: rename atomic_ to qatomic_ 2020-09-23 16:07:44 +01:00
bitops.rst
blkdebug.txt docs/: fix some comment spelling errors 2020-09-17 20:37:13 +02:00
blkverify.txt meson: link emulators without Makefile.target 2020-08-21 06:30:40 -04:00
block-coroutine-wrapper.rst scripts: add block-coroutine-wrapper.py 2020-10-05 10:59:06 +01:00
build-system.rst configure: automatically parse command line for meson -D options 2021-10-14 09:51:06 +02:00
ci-definitions.rst.inc docs: name included files ".rst.inc" 2021-10-01 19:04:45 +02:00
ci-jobs.rst.inc docs: name included files ".rst.inc" 2021-10-01 19:04:45 +02:00
ci-runners.rst.inc docs: name included files ".rst.inc" 2021-10-01 19:04:45 +02:00
ci.rst docs: name included files ".rst.inc" 2021-10-01 19:04:45 +02:00
clocks.rst clock: Provide builtin multiplier/divider 2021-09-01 11:08:19 +01:00
code-of-conduct.rst docs: link to archived Fedora code of conduct 2021-09-13 13:56:26 +02:00
conflict-resolution.rst docs: Add a QEMU Code of Conduct and Conflict Resolution Policy document 2021-04-01 13:21:02 +02:00
control-flow-integrity.rst Fix typo in CFI build documentation 2021-05-02 17:24:50 +02:00
decodetree.rst decodetree: Extend argument set syntax to allow types 2021-05-01 11:45:35 -07:00
ebpf_rss.rst docs/devel/ebpf_rss.rst: Format literals correctly 2021-08-02 11:42:38 +01:00
fuzzing.rst fuzz: add instructions for building reproducers 2021-03-16 14:30:30 -04:00
index.rst docs: standardize directory index to --- with overline 2021-09-13 13:56:26 +02:00
kconfig.rst configure, meson: move CONFIG_IVSHMEM to meson 2021-07-06 08:33:51 +02:00
loads-stores.rst accel/tcg: Add cpu_{ld,st}*_mmu interfaces 2021-10-13 08:09:53 -07:00
lockcnt.txt docs: fix references to docs/devel/atomics.rst 2021-06-02 06:51:09 +02:00
memory.rst
migration.rst docs/devel/migration.rst: Format literals correctly 2021-08-02 11:42:38 +01:00
modules.rst modules: hook up modules.h to docs build 2021-07-09 18:21:33 +02:00
multi-process.rst docs: move notes inside the body of the document 2021-10-01 19:04:45 +02:00
multi-thread-tcg.rst docs/devel: Add a single top-level header to MTTCG's doc 2021-06-25 10:05:36 +01:00
multiple-iothreads.txt
qapi-code-gen.rst qapi: Enable enum member introspection to show more than name 2021-10-27 17:18:43 +02:00
qgraph.rst docs: reorganize qgraph.rst 2021-10-01 19:04:45 +02:00
qom.rst modules: add module_obj() note to QOM docs 2021-07-09 18:20:27 +02:00
qtest.rst libqos/qgraph: format qgraph comments for sphinx documentation 2021-03-09 11:26:31 +01:00
rcu.txt Docs/RCU: Correct sample code of qatomic_rcu_set 2021-01-12 12:38:03 +01:00
replay.txt
reset.rst
s390-dasd-ipl.rst
secure-coding-practices.rst docs/secure-coding-practices: Describe how to use 'null-co' block driver 2021-06-02 14:29:14 +02:00
stable-process.rst
style.rst docs/devel: expand style section of memory management 2021-03-24 14:24:52 +00:00
tcg-icount.rst tcg: Drop gen_io_end() 2021-09-08 11:09:45 +01:00
tcg-plugins.rst docs: reorganize tcg-plugins.rst 2021-10-01 19:04:45 +02:00
tcg.rst docs/devel: Explain in more detail the TB chaining mechanisms 2021-06-13 17:42:40 -07:00
testing.rst docs: reorganize testing.rst 2021-10-01 19:04:45 +02:00
tracing.rst trace: update docs with meson build information 2021-02-01 11:23:04 +00:00
ui.rst ui: add clipboard documentation 2021-05-21 09:42:44 +02:00
vfio-migration.rst docs/devel: Add VFIO device migration documentation 2021-06-18 08:38:04 -06:00
virtio-migration.txt
writing-qmp-commands.rst docs: convert writing-qmp-commands.txt to writing-qmp-commands.rst 2021-08-04 11:18:05 +02:00