qapi: Allow getting flat output from 'query-named-block-nodes'

When a management application manages node names there's no reason to
recurse into backing images in the output of query-named-block-nodes.

Add a parameter to the command which will return just the top level
structs.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Message-Id: <4470f8c779abc404dcf65e375db195cd91a80651.1579509782.git.pkrempa@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
[mreitz: Fixed coding style]
Signed-off-by: Max Reitz <mreitz@redhat.com>
This commit is contained in:
Peter Krempa
2020-02-20 16:43:42 +01:00
committed by Max Reitz
parent b0c4cf21b0
commit facda5443f
7 changed files with 29 additions and 10 deletions
+1 -1
View File
@@ -620,7 +620,7 @@ void hmp_info_block(Monitor *mon, const QDict *qdict)
}
/* Print node information */
blockdev_list = qmp_query_named_block_nodes(NULL);
blockdev_list = qmp_query_named_block_nodes(false, false, NULL);
for (blockdev = blockdev_list; blockdev; blockdev = blockdev->next) {
assert(blockdev->value->has_node_name);
if (device && strcmp(device, blockdev->value->node_name)) {