From: Kevin Wolf <kwolf@redhat.com>
To: Fiona Ebner <f.ebner@proxmox.com>
Cc: qemu-block@nongnu.org, qemu-devel@nongnu.org, hreitz@redhat.com,
eblake@redhat.com, armbru@redhat.com
Subject: Re: [PATCH v2] block: include child references in block device info
Date: Wed, 2 Jul 2025 11:13:46 +0200 [thread overview]
Message-ID: <aGT4SoV76ViyN6XS@redhat.com> (raw)
In-Reply-To: <20250701162124.1313813-1-f.ebner@proxmox.com>
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.ebner@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
next prev parent reply other threads:[~2025-07-02 9:14 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-01 16:21 [PATCH v2] block: include child references in block device info Fiona Ebner
2025-07-02 9:13 ` Kevin Wolf [this message]
2025-07-02 9:39 ` Fiona Ebner
2025-07-02 10:44 ` Kevin Wolf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aGT4SoV76ViyN6XS@redhat.com \
--to=kwolf@redhat.com \
--cc=armbru@redhat.com \
--cc=eblake@redhat.com \
--cc=f.ebner@proxmox.com \
--cc=hreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.