qdict: Extract non-QDicts in qdict_array_split()
Currently, qdict_array_split() only splits off entries with a key prefixof "%u.", packing them into a new QDict. This patch makes it supportentries with the plain key "%u" as well, directly putting them into the...
qdict: Add qdict_array_split()
This function splits a QDict consisting of entries prefixed byincrementally enumerated indices into a QList of QDicts.
Signed-off-by: Max Reitz <mreitz@redhat.com>Reviewed-by: Kevin Wolf <kwolf@redhat.com>Reviewed-by: Eric Blake <eblake@redhat.com>...
qapi: extend qdict_flatten() for QLists
Reversing qdict_array_split(), qdict_flatten() should flatten QLists aswell by interpreting them as QDicts where every entry's key is itsindex.
This allows bringing QDicts with QLists from QMP commands to the same...
qerror: Remove assert_no_error()
This is no longer needed, and is obsoleted by error_abort. Remove.
Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>Reviewed-by: Markus Armbruster <armbru@redhat.com>Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Merge remote-tracking branch 'kwolf/tags/for-anthony' into staging
Block patches for 2.0 (flushing block-next)
qobject: Fix compiler warning (missing gnu_printf format attribute)
gcc 4.8.2 reports this warning when extra warnings are enabled (-Wextra):
CC qobject/qerror.oqobject/qerror.c: In function ‘qerror_from_info’:qobject/qerror.c:53:5: error: function might be possible candidate for ‘gnu_printf’ format attribute [-Werror=suggest-attribute=format]...
qdict: Fix memory leak in qdict_do_flatten()
Reported-by: Laszlo Ersek <lersek@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
qdict: Optimise qdict_do_flatten()
Nested QDicts used to be both entered recursively in order to move theirentries to the target QDict and also be moved themselves to the targetQDict like all other objects. This is harmless because for the toplevel, qdict_do_flatten() will encounter the (now empty) QDict for a...
qdict: Extract qdict_extract_subqdict
Signed-off-by: Benoit Canet <benoit@irqsave.net>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Implement qdict_flatten()
qdict_flatten(): For each nested QDict with key x, all fields with key yare moved to this QDict and their key is renamed to "x.y". This operationis applied recursively for nested QDicts.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>...
qapi: Anonymous unions
The discriminator for anonymous unions is the data type. This allows tohave a union type that allows both of these:
{ 'file': 'my_existing_block_device_id' } { 'file': { 'filename': '/tmp/mydisk.qcow2', 'read-only': true } }...
json-parser: fix handling of large whole number values
Currently our JSON parser assumes that numbers lacking a fractionalvalue are integers and attempts to store them as QInt/int64 values. Thisbreaks in the case where the number overflows/underflows int64 values (which...
qjson: to_json() case QTYPE_QSTRING is buggy, rewrite
Known bugs in to_json():
qstring: add qstring_get_length()
Long overdue.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>Reviewed-by: Eric Blake <eblake@redhat.com>Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Add qdict_clone_shallow()
Signed-off-by: Kevin Wolf <kwolf@redhat.com>Reviewed-by: Eric Blake <eblake@redhat.com>Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
build: move qobject files to qobject/ and libqemuutil.a
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>