qapi: extend qdict_flatten() for QLists
commit9f23fc0c23ab16e9c16b41ed300786924f7a7768
authorMax Reitz <mreitz@redhat.com>
Fri, 20 Dec 2013 18:28:04 +0000 (20 19:28 +0100)
committerKevin Wolf <kwolf@redhat.com>
Wed, 22 Jan 2014 11:07:17 +0000 (22 12:07 +0100)
treed59cb201a0c83697da305b5fc08db4237813246f
parent05a8c2227157eda2540404999c4615d3bf343c18
qapi: extend qdict_flatten() for QLists

Reversing qdict_array_split(), qdict_flatten() should flatten QLists as
well by interpreting them as QDicts where every entry's key is its
index.

This allows bringing QDicts with QLists from QMP commands to the same
form as they would be given as command-line options, thereby allowing
them to be parsed the same way.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
qobject/qdict.c