aboutsummaryrefslogtreecommitdiff
path: root/blockdev.c
diff options
context:
space:
mode:
authorPeter Krempa <pkrempa@redhat.com>2020-01-20 09:50:49 +0100
committerMax Reitz <mreitz@redhat.com>2020-02-20 16:43:42 +0100
commitfacda5443f5a8676fb635b82ac1046ac6b6a67ce (patch)
tree4309b8f137bf448d3ee569befa64b63d0e1b1f81 /blockdev.c
parentb0c4cf21b0f26533e4aa6ca1930b2c9f52371bfa (diff)
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>
Diffstat (limited to 'blockdev.c')
-rw-r--r--blockdev.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/blockdev.c b/blockdev.c
index 45de0ba37e..011dcfec27 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -3734,9 +3734,13 @@ void qmp_drive_backup(DriveBackup *backup, Error **errp)
blockdev_do_action(&action, errp);
}
-BlockDeviceInfoList *qmp_query_named_block_nodes(Error **errp)
+BlockDeviceInfoList *qmp_query_named_block_nodes(bool has_flat,
+ bool flat,
+ Error **errp)
{
- return bdrv_named_nodes_list(errp);
+ bool return_flat = has_flat && flat;
+
+ return bdrv_named_nodes_list(return_flat, errp);
}
XDbgBlockGraph *qmp_x_debug_query_block_graph(Error **errp)