qemu-e2k/docs
Eric Blake 02a57ae32b qapi: Forbid empty unions and useless alternates
Empty unions serve no purpose, and while we compile with gcc
which permits them, strict C99 forbids them.  We happen to inject
a dummy 'void *data' member into the C unions that represent QAPI
unions and alternates, but we want to get rid of that member (it
pollutes the namespace for no good reason), which would leave us
with an empty union if the user didn't provide any branches.  While
empty structs make sense in QAPI, empty unions don't add any
expressiveness to the QMP language.  So prohibit them at parse
time.  Update the documentation and testsuite to match.

Note that the documentation already mentioned that alternates
should have "two or more JSON data types"; so this also fixes
the code to enforce that.  However, we have existing uses of a
union type with only one branch, so the 2-or-more strictness
is intentionally limited to alternates.

Signed-off-by: Eric Blake <eblake@redhat.com>
Message-Id: <1455778109-6278-3-git-send-email-eblake@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
2016-02-19 11:08:56 +01:00
..
specs parallels: add format spec 2015-12-22 16:01:07 +08:00
aio_notify_accept.promela AioContext: optimize clearing the EventNotifier 2015-07-22 12:41:40 +01:00
aio_notify_bug.promela AioContext: fix broken placement of event_notifier_test_and_clear 2015-07-22 12:41:40 +01:00
aio_notify.promela AioContext: fix broken ctx->dispatching optimization 2015-07-22 12:41:40 +01:00
atomics.txt docs/atomics.txt: fix two typos 2015-04-30 16:05:48 +03:00
bitmaps.md docs: update bitmaps.md 2015-11-17 18:35:56 +08:00
blkdebug.txt blkdebug: Merge hand-rolled and qapi BlkdebugEvent enum 2015-12-17 08:21:27 +01:00
blkverify.txt
bootindex.txt
build-system.txt docs: describe the QEMU build system structure / design 2015-09-25 12:20:18 +02:00
ccid.txt
ich9-ehci-uhci.cfg
image-fuzzer.txt
live-block-ops.txt
memory-hotplug.txt docs: update documentation for memory hot unplug 2015-04-27 21:07:38 +02:00
memory.txt docs/memory.txt: Improve list of different memory regions 2016-02-09 15:46:55 +01:00
migration.txt Add postcopy documentation 2015-11-10 14:51:48 +01:00
multi-thread-compression.txt docs: Add a doc about multiple thread compression 2015-05-06 17:36:57 +02:00
multiple-iothreads.txt
multiseat.txt maint: remove / fix many doubled words 2015-09-11 10:21:38 +03:00
pci_expander_bridge.txt docs/pci_expander_bridge: fix typo 2015-12-22 18:39:20 +02:00
q35-chipset.cfg
qapi-code-gen.txt qapi: Forbid empty unions and useless alternates 2016-02-19 11:08:56 +01:00
qcow2-cache.txt docs: document how to configure the qcow2 L2/refcount caches 2015-09-04 21:00:32 +02:00
qdev-device-use.txt
qemupciserial.inf
qmp-events.txt Migration: Emit event at start of pass 2016-01-13 16:02:13 +05:30
qmp-intro.txt docs: Move files from docs/qmp/ to docs/ 2015-10-12 18:44:53 +02:00
qmp-spec.txt qmp-spec: fix index in doc 2016-02-11 15:15:46 +03:00
rcu.txt doc/rcu: fix g_free_rcu() usage example 2015-10-19 10:13:07 +02:00
rdma.txt
replay.txt replay: global variables and function stubs 2015-11-05 12:19:08 +01:00
spice-port-fqdn.txt
tracing.txt docs: update the usage example of "dtrace" backend in tracing.txt 2015-10-09 10:14:05 +01:00
usb2.txt
usb-storage.txt
virtio-balloon-stats.txt
virtio-migration.txt virtio: add some migration doc 2015-10-22 14:34:48 +03:00
vnc-ledstate-Pseudo-encoding.txt
win32-qemu-event.promela qemu-thread: add a fast path to the Win32 QemuEvent 2015-09-24 20:52:28 +02:00
writing-qmp-commands.txt error: More error_setg() usage 2015-11-11 18:56:26 +01:00
xbzrle.txt xbzrle: optimize XBZRLE to decrease the cache misses 2015-01-15 17:49:43 +05:30
xen-save-devices-state.txt