From bd50530a9f40f6560a03caeaaddd451e2ce90ed8 Mon Sep 17 00:00:00 2001 From: Kevin Wolf Date: Wed, 21 Jan 2015 17:15:44 +0100 Subject: 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 Reviewed-by: Eric Blake Reviewed-by: Max Reitz --- include/qapi/qmp/qdict.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/qapi') diff --git a/include/qapi/qmp/qdict.h b/include/qapi/qmp/qdict.h index d68f4eb4d5..d20db943fb 100644 --- a/include/qapi/qmp/qdict.h +++ b/include/qapi/qmp/qdict.h @@ -70,6 +70,7 @@ void qdict_flatten(QDict *qdict); void qdict_extract_subqdict(QDict *src, QDict **dst, const char *start); void qdict_array_split(QDict *src, QList **dst); +int qdict_array_entries(QDict *src, const char *subqdict); void qdict_join(QDict *dest, QDict *src, bool overwrite); -- cgit v1.2.3