qemu/tests
Daniel P. Berrange cbd8acf38f qapi: qobject input visitor variant for use with keyval_parse()
Currently the QObjectInputVisitor assumes that all scalar values are
directly represented as the final types declared by the thing being
visited. i.e. it assumes an 'int' is using QInt, and a 'bool' is using
QBool, etc.  This is good when QObjectInputVisitor is fed a QObject
that came from a JSON document on the QMP monitor, as it will strictly
validate correctness.

To allow QObjectInputVisitor to be reused for visiting a QObject
originating from keyval_parse(), an alternative mode is needed where
all the scalars types are represented as QString and converted on the
fly to the final desired type.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Message-Id: <1475246744-29302-8-git-send-email-berrange@redhat.com>

Rebased, conflicts resolved, commit message updated to refer to
keyval_parse().  autocast replaced by keyval in identifiers,
noautocast replaced by fail in tests.

Fix qobject_input_type_uint64_keyval() not to reject '-', for QemuOpts
compatibility: replace parse_uint_full() by open-coded
parse_option_number().  The next commit will add suitable tests.
Leave out the fancy ERANGE error reporting for now, but add a TODO
comment.  Add it qobject_input_type_int64_keyval() and
qobject_input_type_number_keyval(), too.

Open code parse_option_bool() and parse_option_size() so we have to
call qobject_input_get_name() only when actually needed.  Again, leave
out ERANGE error reporting for now.

QAPI/QMP downstream extension prefixes __RFQDN_ don't work, because
keyval_parse() splits them at '.'.  This will be addressed later in
the series.

qobject_input_type_int64_keyval(), qobject_input_type_uint64_keyval(),
qobject_input_type_number_keyval() tweaked for style.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <1488317230-26248-5-git-send-email-armbru@redhat.com>
2017-03-07 16:07:46 +01:00
..
acpi-test-data tests/acpi: update DSDT after last patch 2017-03-02 07:31:26 +02:00
data
docker new: dockerfiles/debian-s390-cross 2017-02-28 20:31:01 +08:00
guest-debug
image-fuzzer
libqos tests: fix virtio-blk-test leaks 2017-03-01 11:58:57 +04:00
migration
multiboot
qapi-schema qapi: add qapi2texi script 2017-01-16 10:10:35 +01:00
qemu-iotests block: Add Error parameter to bdrv_append() 2017-02-28 20:47:51 +01:00
rocker
tcg target/openrisc: Rename the cpu from or32 to or1k 2017-02-14 08:14:58 +11:00
vmstate-static-checker-data
.gitignore keyval: New keyval_parse() 2017-03-07 16:07:46 +01:00
ac97-test.c
acpi-utils.c tests: Move reusable ACPI code into a utility file 2017-03-02 07:14:27 +02:00
acpi-utils.h tests: Move reusable ACPI code into a utility file 2017-03-02 07:14:27 +02:00
ahci-test.c ahci-test: add QMP tray test for ATAPI 2016-11-14 11:15:55 -05:00
atomic_add-bench.c tests: add atomic_add-bench 2016-10-26 08:29:01 -07:00
bios-tables-test.c virtio, pc: fixes, features 2017-03-03 10:09:03 +00:00
boot-order-test.c
boot-sector.c tests/boot-sector: Increase time-out to 90 seconds 2016-10-14 10:06:47 +11:00
boot-sector.h tests/boot-sector: Use mkstemp() to create a unique file name 2016-10-14 10:06:47 +11:00
boot-serial-test.c powernv: Don't test POWER9 CPU yet 2017-03-03 11:30:59 +11:00
check-block.sh tests: allow to specify list of formats to test for check-block.sh 2016-09-23 13:36:09 +02:00
check-qdict.c Don't check qobject_type() before qobject_to_qdict() 2017-02-22 19:52:01 +01:00
check-qfloat.c
check-qint.c
check-qjson.c tests: Don't check qobject_type() before qobject_to_qbool() 2017-02-22 19:52:14 +01:00
check-qlist.c
check-qnull.c qapi: Drop unused non-strict qobject input visitor 2017-03-05 09:14:19 +01:00
check-qom-interface.c tests: fix check-qom-interface leaks 2016-09-08 17:57:32 +04:00
check-qom-proplist.c tests: fix check-qom-proplist leaks 2016-09-08 17:57:32 +04:00
check-qstring.c
crypto-tls-x509-helpers.c
crypto-tls-x509-helpers.h clean-up: removed duplicate #includes 2016-10-28 18:17:24 +03:00
device-introspect-test.c qom: Make all interface types abstract 2017-01-16 17:52:34 +01:00
display-vga-test.c qtest: add display-vga-test to ppc64 2017-01-31 10:10:13 +11:00
drive_del-test.c
ds1338-test.c
e1000-test.c tests: fix e1000-test leak 2017-03-01 11:51:28 +04:00
e1000e-test.c tests: fix e1000e leaks 2017-03-01 11:51:28 +04:00
eepro100-test.c tests: fix eepro100-test leak 2017-03-01 11:51:05 +04:00
endianness-test.c tests: fix endianness-test leaks 2017-03-01 00:09:28 +04:00
es1370-test.c
fdc-test.c
fw_cfg-test.c
hd-geo-test.c tests: fix hd-geo-test leaks 2017-03-01 11:51:04 +04:00
i440fx-test.c tests: fix i440fx-test leaks 2017-03-01 11:51:28 +04:00
i82801b11-test.c
ide-test.c tests: fix ide-test leaks 2017-03-01 11:51:04 +04:00
intel-hda-test.c
io-channel-helpers.c
io-channel-helpers.h
ioh3420-test.c
iothread.c aio: introduce aio_co_schedule and aio_co_wake 2017-02-21 11:14:07 +00:00
iothread.h aio: introduce aio_co_schedule and aio_co_wake 2017-02-21 11:14:07 +00:00
ipmi-bt-test.c tests: fix ipmi-bt-test leak 2017-03-01 11:51:05 +04:00
ipmi-kcs-test.c tests: fix ipmi-kcs-test leak 2017-03-01 11:51:05 +04:00
ipoctal232-test.c
ivshmem-test.c qtest: add ivshmem-test for ppc64 2017-01-31 10:10:13 +11:00
libqtest.c qmp-test: New, covering basic QMP protocol 2017-03-05 09:02:10 +01:00
libqtest.h qmp-test: New, covering basic QMP protocol 2017-03-05 09:02:10 +01:00
m25p80-test.c aspeed/smc: extend tests for Command mode 2017-01-20 11:15:08 +00:00
m48t59-test.c
Makefile.include keyval: New keyval_parse() 2017-03-07 16:07:46 +01:00
ne2000-test.c
nvme-test.c
pc-cpu-test.c tests: pc-cpu-test leaks fixes 2016-09-08 18:05:22 +04:00
pcnet-test.c
pkix_asn1_tab.c qtest: fix make check complaint in crypto module 2016-10-19 10:09:24 +01:00
pnv-xscom-test.c powernv: Don't test POWER9 CPU yet 2017-03-03 11:30:59 +11:00
postcopy-test.c tests: fix qmp response leak 2017-03-01 00:09:28 +04:00
prom-env-test.c tests/prom-env: Enable the test for the sun4u machine, too 2017-02-28 09:03:39 +03:00
ptimer-test-stubs.c tests: fix ptimer leaks 2017-03-01 00:09:28 +04:00
ptimer-test.c tests: fix ptimer leaks 2017-03-01 00:09:28 +04:00
ptimer-test.h tests: ptimer: Change the copyright comment 2016-10-24 16:26:53 +01:00
pvpanic-test.c tests: fix qmp response leak 2017-03-01 00:09:28 +04:00
pxe-test.c tests/boot-sector: Use mkstemp() to create a unique file name 2016-10-14 10:06:47 +11:00
q35-test.c tests: fix q35-test leaks 2017-03-01 11:50:33 +04:00
qemu-iotests-quick.sh
qht-bench.c qht-bench: relax test_start/stop atomic accesses 2016-10-24 15:27:19 +02:00
qmp-test.c qapi: Drop unused non-strict qobject input visitor 2017-03-05 09:14:19 +01:00
qom-test.c tests: fix qom-test leaks 2016-09-08 18:05:21 +04:00
rcutorture.c
rtas-test.c tests: don't check if qtest_spapr_boot() returns NULL 2016-10-28 09:36:58 +11:00
rtc-test.c
rtl8139-test.c libqos: Change PCI accessors to take opaque BAR handle 2016-10-28 09:38:27 +11:00
spapr-phb-test.c spapr: Improved placement of PCI host bridges in guest memory map 2016-10-16 12:04:15 +11:00
tco-test.c tests: fix tco-test leaks 2017-03-01 11:51:25 +04:00
test-aio-multithread.c tests-aio-multithread: use atomic_read properly 2017-02-27 12:54:08 +00:00
test-aio.c aio: add AioPollFn and io_poll() interface 2017-01-03 16:38:48 +00:00
test-arm-mptimer.c tests: Add tests for the ARM MPTimer 2016-10-24 16:26:54 +01:00
test-base64.c
test-bitcnt.c tests: New test-bitcnt 2017-01-10 08:49:59 -08:00
test-bitops.c
test-blockjob-txn.c blockjob: Add permissions to block_job_create() 2017-02-28 20:40:37 +01:00
test-blockjob.c tests: Remove FIXME comments 2017-02-28 20:47:50 +01:00
test-bufferiszero.c cutils: Add test for buffer_is_zero 2016-09-13 19:13:32 +02:00
test-char.c char: rename CharDriverState Chardev 2017-01-27 18:07:59 +01:00
test-clone-visitor.c
test-coroutine.c test-coroutine: test qemu_coroutine_entered() 2016-09-28 17:11:23 +01:00
test-crypto-afsplit.c
test-crypto-block.c tests: No longer dependent on CONFIG_UUID 2016-09-23 11:42:52 +08:00
test-crypto-cipher.c crypto: add 3des-ede support when using libgcrypt/nettle 2016-12-21 14:26:26 +00:00
test-crypto-hash.c crypto: fix initialization of crypto in tests 2016-10-19 10:23:55 +01:00
test-crypto-hmac.c crypto: add HMAC algorithms testcases 2016-12-22 09:24:59 +00:00
test-crypto-ivgen.c
test-crypto-pbkdf.c crypto: support more hash algorithms for pbkdf 2016-09-19 16:30:45 +01:00
test-crypto-secret.c
test-crypto-tlscredsx509.c
test-crypto-tlssession.c
test-crypto-xts.c
test-cutils.c util/cutils: Change qemu_strtosz*() from int64_t to uint64_t 2017-02-23 20:35:36 +01:00
test-filter-mirror.c tests: fix qmp response leak 2017-03-01 00:09:28 +04:00
test-filter-redirector.c tests: fix qmp response leak 2017-03-01 00:09:28 +04:00
test-hbitmap.c test-hbitmap: Add hbitmap_is_serializable() calls 2017-01-26 10:25:01 +08:00
test-int128.c int128: Use __int128 if available 2016-10-26 08:29:00 -07:00
test-io-channel-buffer.c
test-io-channel-command.c tests: fix leaks in test-io-channel-command 2017-03-01 00:09:28 +04:00
test-io-channel-file.c
test-io-channel-socket.c io: change the QIOTask callback signature 2017-01-23 15:32:18 +00:00
test-io-channel-tls.c io: change the QIOTask callback signature 2017-01-23 15:32:18 +00:00
test-io-task.c io: fix possible double free of task error object 2017-01-26 10:26:18 +00:00
test-iov.c tests: fix test-iov leaks 2016-09-08 17:57:32 +04:00
test-keyval.c keyval: New keyval_parse() 2017-03-07 16:07:46 +01:00
test-logging.c
test-mul64.c
test-netfilter.c
test-opts-visitor.c tests: Cover input visit beyond end of list 2017-03-05 09:14:20 +01:00
test-qdev-global-props.c
test-qdist.c
test-qemu-opts.c test-qemu-opts: Cover qemu_opts_parse() of "no" 2017-03-07 16:07:46 +01:00
test-qga.c qemu-ga patch queue for 2.9 2017-03-07 07:32:28 +00:00
test-qht-par.c
test-qht.c test-qht: perform lookups under rcu_read_lock 2016-10-06 18:04:13 +02:00
test-qmp-commands.c qapi: Drop unused non-strict qobject input visitor 2017-03-05 09:14:19 +01:00
test-qmp-event.c test-qmp-event: Simplify and tighten event_test_emit() 2017-02-22 19:51:59 +01:00
test-qobject-input-visitor.c qapi: qobject input visitor variant for use with keyval_parse() 2017-03-07 16:07:46 +01:00
test-qobject-output-visitor.c tests: Don't check qobject_type() before qobject_to_qbool() 2017-02-22 19:52:14 +01:00
test-rcu-list.c
test-replication.c test-replication: fix leaks 2016-11-15 15:41:00 +00:00
test-shift128.c host-utils: Implement unsigned quadword left/right shift and unit tests 2017-01-31 10:10:14 +11:00
test-string-input-visitor.c tests: Cover input visit beyond end of list 2017-03-05 09:14:20 +01:00
test-string-output-visitor.c qapi: rename *qmp-*-visitor* to *qobject-*-visitor* 2016-10-25 16:25:48 +02:00
test-thread-pool.c test-thread-pool: use generic AioContext infrastructure 2017-02-21 11:14:07 +00:00
test-throttle.c tests: Remove FIXME comments 2017-02-28 20:47:50 +01:00
test-timed-average.c
test-uuid.c test-uuid: fix leak 2016-11-11 20:53:23 +08:00
test-visitor-serialization.c qapi: Drop unused non-strict qobject input visitor 2017-03-05 09:14:19 +01:00
test-vmstate.c tests/test-vmstate.c: test array of ptr to primitive 2017-02-28 11:30:22 +00:00
test-write-threshold.c
test-x86-cpuid-compat.c target-i386: Print warning when mixing [+-]foo and foo=(on|off) 2016-10-31 16:20:59 -02:00
test-x86-cpuid.c
test-xbzrle.c
tmp105-test.c
tpci200-test.c
usb-hcd-ehci-test.c tests: fix usb-test leaks 2017-03-01 11:51:29 +04:00
usb-hcd-ohci-test.c
usb-hcd-uhci-test.c tests: fix usb-test leaks 2017-03-01 11:51:29 +04:00
usb-hcd-xhci-test.c
vhost-user-bridge.c tests/vhost-user-bridge: use contrib/libvhost-user 2016-12-16 01:14:38 +02:00
vhost-user-test.c tests: fix vhost-user-test leaks 2017-03-01 11:51:00 +04:00
virtio-9p-test.c tests: fix virtio-9p-test leaks 2017-03-01 11:51:28 +04:00
virtio-balloon-test.c
virtio-blk-test.c tests: fix virtio-blk-test leaks 2017-03-01 11:58:57 +04:00
virtio-console-test.c
virtio-net-test.c tests: enable virtio tests on SPAPR 2016-10-28 09:36:58 +11:00
virtio-rng-test.c tests: enable virtio tests on SPAPR 2016-10-28 09:36:58 +11:00
virtio-scsi-test.c tests: fix virtio-scsi-test leak 2017-03-01 11:51:28 +04:00
virtio-serial-test.c
vmxnet3-test.c
wdt_ib700-test.c