mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 08:13:54 -06:00
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:
parent
b0c4cf21b0
commit
facda5443f
7 changed files with 29 additions and 10 deletions
5
block.c
5
block.c
|
@ -4807,14 +4807,15 @@ BlockDriverState *bdrv_find_node(const char *node_name)
|
|||
}
|
||||
|
||||
/* Put this QMP function here so it can access the static graph_bdrv_states. */
|
||||
BlockDeviceInfoList *bdrv_named_nodes_list(Error **errp)
|
||||
BlockDeviceInfoList *bdrv_named_nodes_list(bool flat,
|
||||
Error **errp)
|
||||
{
|
||||
BlockDeviceInfoList *list, *entry;
|
||||
BlockDriverState *bs;
|
||||
|
||||
list = NULL;
|
||||
QTAILQ_FOREACH(bs, &graph_bdrv_states, node_list) {
|
||||
BlockDeviceInfo *info = bdrv_block_device_info(NULL, bs, errp);
|
||||
BlockDeviceInfo *info = bdrv_block_device_info(NULL, bs, flat, errp);
|
||||
if (!info) {
|
||||
qapi_free_BlockDeviceInfoList(list);
|
||||
return NULL;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue