qemu-e2k/qapi
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
..
acpi.json
audio.json sdlaudio: add -audiodev sdl,out.buffer-count option 2021-01-15 11:25:22 +01:00
authz.json qapi/qom: Add ObjectOptions for authz-* 2021-03-19 10:17:13 +01:00
block-core.json qapi: Add spaces after symbol declaration for consistency 2021-10-02 07:33:41 +02:00
block-export.json qapi: make 'if' condition strings simple identifiers 2021-08-26 13:53:56 +02:00
block.json qapi: Normalize version references x.y.0 to just x.y 2020-12-10 17:16:44 +01:00
char.json qapi: Convert simple union ChardevBackend to flat one 2021-09-27 08:23:09 +02:00
common.json qapi/qom: Add ObjectOptions for input-* 2021-03-19 10:17:14 +01:00
compat.json qapi: New -compat deprecated-input=crash 2021-03-19 16:05:11 +01:00
control.json monitor: remove 'query-events' QMP command 2021-03-18 09:22:55 +00:00
crypto.json crypto: replace 'des-rfb' cipher with 'des' 2021-07-14 14:15:52 +01:00
dump.json
error.json
introspect.json qapi: Enable enum member introspection to show more than name 2021-10-27 17:18:43 +02:00
job.json migration: introduce snapshot-{save, load, delete} QMP commands 2021-02-08 11:19:52 +00:00
machine-target.json qapi: make 'if' condition strings simple identifiers 2021-08-26 13:53:56 +02:00
machine.json qapi: Include qom-path in MEMORY_DEVICE_SIZE_CHANGE qapi events 2021-10-02 08:43:21 +02:00
meson.build qapi: introduce forwarding visitor 2021-07-23 18:17:17 +02:00
migration.json qapi: make 'if' condition strings simple identifiers 2021-08-26 13:53:56 +02:00
misc-target.json qapi/misc-target: Group SEV QAPI definitions 2021-10-13 10:47:49 +02:00
misc.json iothread: add aio-max-batch parameter 2021-07-21 13:47:50 +01:00
net.json netdev: add more commands to preconfig mode 2021-06-11 10:30:13 +08:00
opts-visitor.c qapi, qemu-options: make all parsing visitors parse boolean options the same 2020-11-04 12:00:40 -05:00
pci.json qapi: Normalize version references x.y.0 to just x.y 2020-12-10 17:16:44 +01:00
pragma.json block: Remove monitor command block_passwd 2021-03-23 22:31:56 +01:00
qapi-clone-visitor.c
qapi-dealloc-visitor.c
qapi-forward-visitor.c qapi: introduce forwarding visitor 2021-07-23 18:17:17 +02:00
qapi-schema.json qemu-options: New -compat to set policy for deprecated interfaces 2021-03-19 15:43:33 +01:00
qapi-util.c qapi, qemu-options: make all parsing visitors parse boolean options the same 2020-11-04 12:00:40 -05:00
qapi-visit-core.c qapi: Improve input_type_enum()'s error message 2021-10-27 17:17:28 +02:00
qdev.json vl: Enable JSON syntax for -device 2021-10-15 16:11:22 +02:00
qmp-dispatch.c qapi: New -compat deprecated-input=crash 2021-03-19 16:05:11 +01:00
qmp-event.c
qmp-registry.c qga: return a more explicit error on why a command is disabled 2021-03-16 20:21:47 -05:00
qobject-input-visitor.c qapi: New -compat deprecated-input=crash 2021-03-19 16:05:11 +01:00
qobject-output-visitor.c qapi: Implement deprecated-output=hide for QMP command results 2021-03-19 15:43:33 +01:00
qom.json qapi: Make some ObjectTypes depend on the build settings 2021-10-13 10:47:49 +02:00
rdma.json
replay.json
rocker.json
run-state.json runstate: cleanup reboot and panic actions 2021-01-21 13:00:41 +01:00
sockets.json build-sys: add HAVE_IPPROTO_MPTCP 2021-09-30 15:30:25 +02:00
string-input-visitor.c qapi, qemu-options: make all parsing visitors parse boolean options the same 2020-11-04 12:00:40 -05:00
string-output-visitor.c string-output-visitor: Fix to use sufficient precision 2020-12-19 10:37:16 +01:00
tpm.json qapi: Convert simple union TpmTypeOptions to flat one 2021-09-27 08:22:25 +02:00
trace-events docs: fix references to docs/devel/tracing.rst 2021-06-02 06:51:09 +02:00
trace.h
trace.json qapi: Set boolean value correctly in examples 2021-09-03 17:03:05 +02:00
transaction.json qapi: Convert simple union TransactionAction to flat one 2021-09-27 08:23:25 +02:00
ui.json qapi: Convert simple union InputEvent to flat one 2021-09-25 06:55:54 +02:00
yank.json Introduce yank feature 2021-01-13 10:21:17 +01:00