qdict: Add qdict_array_entries()
authorKevin Wolf <kwolf@redhat.com>
Wed, 21 Jan 2015 16:15:44 +0000 (17:15 +0100)
committerKevin Wolf <kwolf@redhat.com>
Fri, 12 Jun 2015 14:58:06 +0000 (16:58 +0200)
commitbd50530a9f40f6560a03caeaaddd451e2ce90ed8
treebe6ecbd04757b119babeaa7e94ea205de7730fe6
parenta68197ff5b11f5a58d48e485d16a36758aeca7f4
qdict: Add qdict_array_entries()

This counts the entries in a flattened array in a QDict without
actually splitting the QDict into a QList.

bdrv_open_image() doesn't take a QList, but rather a QDict and a key
prefix string, so this is more convenient for block drivers which have a
dynamically sized list of child nodes (e.g. Quorum) and are to be
converted to using bdrv_open_image() as the standard interface for
opening child nodes.

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