unicorn/qemu
Eric Blake 23ab6d81f9
qapi: Implement boxed types for commands/events
Turn on the ability to pass command and event arguments in
a single boxed parameter, which must name a non-empty type
(although the type can be a struct with all optional members).
For structs, it makes it possible to pass a single qapi type
instead of a breakout of all struct members (useful if the
arguments are already in a struct or if the number of members
is large); for other complex types, it is now possible to use
a union or alternate as the data for a command or event.

The empty type may be technically feasible if needed down the
road, but it's easier to forbid it now and relax things to allow
it later, than it is to allow it now and have to special case
how the generated 'q_empty' type is handled (see commit 7ce106a9
for reasons why nothing is generated for the empty type). An
alternate type is never considered empty, but now that a boxed
type can be either an object or an alternate, we have to provide
a trivial QAPISchemaAlternateType.is_empty(). The new call to
arg_type.is_empty() during QAPISchemaCommand.check() requires
that we first check the type in question; but there is no chance
of introducing a cycle since objects do not refer back to commands.

We still have a split in syntax checking between ad-hoc parsing
up front (merely validates that 'boxed' has a sane value) and
during .check() methods (if 'boxed' is set, then 'data' must name
a non-empty user-defined type).

Generated code is unchanged, as long as no client uses the
new feature.

Backports commit c818408e449ea55371253bd4def1c1dc87b7bb03 from qemu
2018-02-25 20:22:03 -05:00
..
crypto crypto: Clean up includes 2018-02-19 00:47:40 -05:00
default-configs arm64eb: add support for ARM64 big endian. 2017-04-24 23:30:01 +08:00
docs docs: clarify memory region lifecycle 2018-02-12 15:11:21 -05:00
fpu softfloat: Handle snan_bit_is_one == 0 in MIPS pickNaNMulAdd() 2018-02-24 20:40:11 -05:00
hw qemu-common: push cpu.h inclusion out of qemu-common.h 2018-02-24 01:50:56 -05:00
include compiler: never omit assertions if using a static analysis tool 2018-02-25 19:19:28 -05:00
qapi qapi: change QmpInputVisitor to QSLIST 2018-02-25 20:02:09 -05:00
qobject util: move declarations out of qemu-common.h 2018-02-22 09:25:48 -05:00
qom qapi: Add new visit_complete() function 2018-02-25 01:20:03 -05:00
scripts qapi: Implement boxed types for commands/events 2018-02-25 20:22:03 -05:00
target-arm target-arm: Add missed AArch32 TLBI sytem registers 2018-02-25 19:59:15 -05:00
target-i386 target-i386: Remove redundant HF_SOFTMMU_MASK 2018-02-25 19:59:15 -05:00
target-m68k target-*: Clean up cpu.h header guards 2018-02-25 04:12:46 -05:00
target-mips Clean up ill-advised or unusual header guards 2018-02-25 04:22:46 -05:00
target-sparc target-sparc: Elide duplicate updates to fprs 2018-02-25 19:14:59 -05:00
tcg compiler: never omit assertions if using a static analysis tool 2018-02-25 19:19:28 -05:00
util target-arm: Use Neon for zero checking 2018-02-25 19:17:38 -05:00
aarch64.h header_gen: alphabetize general symbols 2018-02-25 19:07:20 -05:00
aarch64eb.h header_gen: alphabetize general symbols 2018-02-25 19:07:20 -05:00
accel.c accel: make configure_accelerator return void 2018-02-24 00:31:28 -05:00
arm.h header_gen: alphabetize general symbols 2018-02-25 19:07:20 -05:00
armeb.h header_gen: alphabetize general symbols 2018-02-25 19:07:20 -05:00
CODING_STYLE import 2015-08-21 15:04:50 +08:00
configure configure: Enable -Werror for MinGW builds, too 2018-02-24 18:56:05 -05:00
COPYING import 2015-08-21 15:04:50 +08:00
COPYING.LIB import 2015-08-21 15:04:50 +08:00
cpu-exec-common.c cpu-exec: Rename cpu_resume_from_signal() to cpu_loop_exit_noexc() 2018-02-24 17:25:28 -05:00
cpu-exec.c tb hash: hash phys_pc, pc, and flags with xxhash 2018-02-24 18:00:14 -05:00
cpus.c cpu: move exec-all.h inclusion out of cpu.h 2018-02-24 02:39:08 -05:00
cputlb.c cputlb: Add address parameter to VICTIM_TLB_HIT 2018-02-25 03:03:36 -05:00
exec.c exec: avoid realloc in phys_map_node_reserve 2018-02-25 19:32:40 -05:00
gen_all_header.sh arm64eb: add support for ARM64 big endian. 2017-04-24 23:30:01 +08:00
glib_compat.c qapi: Fix memleak in string visitors on int lists 2018-02-25 00:20:34 -05:00
HACKING import 2015-08-21 15:04:50 +08:00
header_gen.py header_gen: alphabetize general symbols 2018-02-25 19:07:20 -05:00
ioport.c hw: remove pio_addr_t 2018-02-24 02:43:16 -05:00
LICENSE import 2015-08-21 15:04:50 +08:00
m68k.h header_gen: alphabetize general symbols 2018-02-25 19:07:20 -05:00
Makefile Makefile: Add a FORCE target 2018-02-24 17:03:51 -05:00
Makefile.objs crypto: move crypto objects out of libqemuutil.la 2018-02-17 15:23:50 -05:00
Makefile.target tcg: split tcg_op_defs to -common 2018-02-17 15:23:51 -05:00
memory.c memory: Provide memory_region_init_rom() 2018-02-25 00:28:17 -05:00
memory_mapping.c include/qemu/osdep.h: Don't include qapi/error.h 2018-02-21 23:08:18 -05:00
mips.h header_gen: alphabetize general symbols 2018-02-25 19:07:20 -05:00
mips64.h header_gen: alphabetize general symbols 2018-02-25 19:07:20 -05:00
mips64el.h header_gen: alphabetize general symbols 2018-02-25 19:07:20 -05:00
mipsel.h header_gen: alphabetize general symbols 2018-02-25 19:07:20 -05:00
powerpc.h header_gen: alphabetize general symbols 2018-02-25 19:07:20 -05:00
qapi-schema.json qapi: Lazy creation of array types 2018-02-19 18:55:35 -05:00
qemu-log.c log: move qemu_log_close/qemu_log_flush from header to log.c 2018-02-22 11:13:17 -05:00
qemu-timer.c all: Clean up includes 2018-02-19 01:34:28 -05:00
rules.mak Makefile: add dependency on scripts/create_config 2018-02-24 17:05:03 -05:00
softmmu_template.h cputlb: Fix for self-modifying writes across page boundaries 2018-02-25 03:12:11 -05:00
sparc.h header_gen: alphabetize general symbols 2018-02-25 19:07:20 -05:00
sparc64.h header_gen: alphabetize general symbols 2018-02-25 19:07:20 -05:00
tcg-runtime.c all: Clean up includes 2018-02-19 01:34:28 -05:00
translate-all.c translate-all: Fix user-mode self-modifying code in 2 page long TB 2018-02-25 03:14:22 -05:00
translate-all.h user-exec: Push resume-from-signal code out to handle_cpu_signal() 2018-02-24 17:21:06 -05:00
translate-common.c exec: Clean up includes 2018-02-19 00:49:55 -05:00
unicorn_common.h qom/cpu: Add MemoryRegion property 2018-02-18 21:54:50 -05:00
VERSION import 2015-08-21 15:04:50 +08:00
vl.c hw: explicitly include qemu/log.h 2018-02-24 02:00:45 -05:00
vl.h import 2015-08-21 15:04:50 +08:00
x86_64.h header_gen: alphabetize general symbols 2018-02-25 19:07:20 -05:00