Am 01.07.2025 um 18:21 hat Fiona Ebner geschrieben:
> In combination with using a throttle filter to enforce IO limits for
> a guest device, knowing the 'file' child of a block device can be
> useful. If the throttle filter is only intended for guest IO, block
> jobs should not also be limited by the throttle filter, so the
> block operations need to be done with the 'file' child of the top
> throttle node as the target. In combination with mirroring, the name
> of that child is not fixed.
> 
> Another scenario is when unplugging a guest device after mirroring
> below a top throttle node, where the mirror target is added explicitly
> via blockdev-add. After mirroring, the target becomes the new 'file'
> child of the throttle node. For unplugging, both the top throttle node
> and the mirror target need to be deleted, because only implicitly
> added child nodes are deleted automatically, and the current 'file'
> child of the throttle node was explicitly added (as the mirror
> target).
> 
> In other scenarios, it could be useful to follow the backing chain.
> 
> Note that iotests 191 and 273 use _filter_img_info, so the 'children'
> information is filtered out there.
> 
> Signed-off-by: Fiona Ebner <f.eb...@proxmox.com>

> diff --git a/qapi/block-core.json b/qapi/block-core.json
> index 1df6644f0d..8816feec2d 100644
> --- a/qapi/block-core.json
> +++ b/qapi/block-core.json
> @@ -461,6 +461,19 @@
>              'direct': 'bool',
>              'no-flush': 'bool' } }
>  
> +##
> +# @BlockdevChild:
> +#
> +# @child: The name of the child, for example 'file' or 'backing'.
> +#
> +# @node-name: The name of the child's block driver node.
> +#
> +# Since: 10.1
> +##
> +{ 'struct': 'BlockdevChild',
> +  'data': { 'child': 'str',
> +            '*node-name': 'str' } }

Is node-name really optional? I don't think we have nodes without a node
name any more, do we?

Same with your check for child->bs, I don't think a BdrvChild without a
bs can exist (or only while creating/destroying the BdrvChild, which
holds the graph lock and doesn't allow monitor commands to run in the
middle).

Kevin


Reply via email to