unicorn/qemu/qapi
David Hildenbrand 8f69c83634
qapi: Rewrite string-input-visitor's integer and list parsing
The input visitor has some problems right now, especially
- unsigned type "Range" is used to process signed ranges, resulting in
inconsistent behavior and ugly/magical code
- uint64_t are parsed like int64_t, so big uint64_t values are not
supported and error messages are misleading
- lists/ranges of int64_t are accepted although no list is parsed and
we should rather report an error
- lists/ranges are preparsed using int64_t, making it hard to
implement uint64_t values or uint64_t lists
- types that don't support lists don't bail out
- visiting beyond the end of a list is not handled properly
- we don't actually parse lists, we parse *sets*: members are sorted,
and duplicates eliminated

So let's rewrite it by getting rid of usage of the type "Range" and
properly supporting lists of int64_t and uint64_t (including ranges of
both types), fixing the above mentioned issues.

Lists of other types are not supported and will properly report an
error. Virtual walks are now supported.

Tests have to be fixed up:
- Two BUGs were hardcoded that are fixed now
- The string-input-visitor now actually returns a parsed list and not
an ordered set.

Please note that no users/callers have to be fixed up. Candidates using
visit_type_uint16List() and friends are:
- backends/hostmem.c:host_memory_backend_set_host_nodes()
-- Code can deal with duplicates/unsorted lists
- numa.c::query_memdev()
-- via object_property_get_uint16List(), the list will still be sorted
and without duplicates (via host_memory_backend_get_host_nodes())
- qapi-visit.c::visit_type_Memdev_members()
- qapi-visit.c::visit_type_NumaNodeOptions_members()
- qapi-visit.c::visit_type_RockerOfDpaGroup_members
- qapi-visit.c::visit_type_RxFilterInfo_members()
-- Not used with string-input-visitor.

Backports commit c9fba9de89db51a07689e2cba4865a1e564b8f0f from qemu
2018-12-18 04:57:25 -05:00
..
common.json qapi: Update scripts to commit 01b2ffcedd94ad7b42bc870e4c6936c87ad03429 2018-03-03 18:32:12 -05:00
Makefile.objs qapi: rename *qmp-*-visitor* to *qobject-*-visitor* 2018-02-26 15:42:37 -05:00
misc.json qapi: Empty out qapi-schema.json 2018-03-09 10:23:27 -05:00
qapi-clone-visitor.c qapi/qnull: Add own header 2018-03-08 08:35:23 -05:00
qapi-dealloc-visitor.c qobject: Replace qobject_incref/QINCREF qobject_decref/QDECREF 2018-05-04 10:16:07 -04:00
qapi-schema.json qapi: Move qapi-schema.json to qapi/, rename generated files 2018-03-09 11:35:11 -05:00
qapi-visit-core.c Include qapi/qmp/qobject.h exactly where needed 2018-03-08 08:48:27 -05:00
qobject-input-visitor.c qobject: Modify qobject_ref() to return obj 2018-05-04 10:24:10 -04:00
qobject-output-visitor.c qobject: Modify qobject_ref() to return obj 2018-05-04 10:24:10 -04:00
string-input-visitor.c qapi: Rewrite string-input-visitor's integer and list parsing 2018-12-18 04:57:25 -05:00