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>
diff --git a/qapi/block-core.json b/qapi/block-core.json
index 37d7ea7..85e27bb 100644
--- a/qapi/block-core.json
+++ b/qapi/block-core.json
@@ -1758,6 +1758,9 @@
#
# Get the named block driver list
#
+# @flat: Omit the nested data about backing image ("backing-image" key) if true.
+# Default is false (Since 5.0)
+#
# Returns: the list of BlockDeviceInfo
#
# Since: 2.0
@@ -1811,7 +1814,9 @@
# } } ] }
#
##
-{ 'command': 'query-named-block-nodes', 'returns': [ 'BlockDeviceInfo' ] }
+{ 'command': 'query-named-block-nodes',
+ 'returns': [ 'BlockDeviceInfo' ],
+ 'data': { '*flat': 'bool' } }
##
# @XDbgBlockGraphNodeType: