]> git.ipfire.org Git - thirdparty/qemu.git/commit
block: Split BlockNodeInfo off of ImageInfo
authorHanna Reitz <hreitz@redhat.com>
Mon, 20 Jun 2022 16:26:56 +0000 (18:26 +0200)
committerKevin Wolf <kwolf@redhat.com>
Wed, 1 Feb 2023 15:52:33 +0000 (16:52 +0100)
commita2085f8909377b6df738f6c3f7ee6db4d16da8f7
tree02a6a08cdfd06178401e7ac58d2f24fe8a595667
parent456e75171a85c19a5bfa202eefcbdc4ef1692f05
block: Split BlockNodeInfo off of ImageInfo

ImageInfo sometimes contains flat information, and sometimes it does
not.  Split off a BlockNodeInfo struct, which only contains information
about a single node and has no link to the backing image.

We do this so we can extend BlockNodeInfo to a BlockGraphInfo struct,
which has links to all child nodes, not just the backing node.  It would
be strange to base BlockGraphInfo on ImageInfo, because then this
extended struct would have two links to the backing node (one in
BlockGraphInfo as one of all the child links, and one in ImageInfo).

Furthermore, it is quite common to ignore the backing-image field
altogether: bdrv_query_image_info() does not set it, and
bdrv_image_info_dump() does not evaluate it.  That signals that we
should have different structs for describing a single node and one that
has a link to the backing image.

Still, bdrv_query_image_info() and bdrv_image_info_dump() are not
changed too much in this patch.  Follow-up patches will handle them.

Signed-off-by: Hanna Reitz <hreitz@redhat.com>
Message-Id: <20220620162704.80987-5-hreitz@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/qapi.c
include/block/qapi.h
qapi/block-core.json