]> git.ipfire.org Git - thirdparty/qemu.git/commit
block/qapi: include child references in block device info
authorFiona Ebner <f.ebner@proxmox.com>
Wed, 2 Jul 2025 12:31:27 +0000 (14:31 +0200)
committerKevin Wolf <kwolf@redhat.com>
Mon, 14 Jul 2025 15:10:57 +0000 (17:10 +0200)
commitcfac5a963e4bf287a194b5df80b7984bc8e41221
tree4081fd6b99c53792d95ee6ecc3322ceef6018e53
parenta256a427b026f26be33ce2ace7158f5ab0931fa8
block/qapi: include child references in block device info

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>
Message-ID: <20250702123204.325470-2-f.ebner@proxmox.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/qapi.c
qapi/block-core.json
tests/qemu-iotests/184.out