diff options
author | Hanna Reitz <hreitz@redhat.com> | 2022-06-20 18:26:56 +0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2023-02-01 16:52:33 +0100 |
commit | a2085f8909377b6df738f6c3f7ee6db4d16da8f7 (patch) | |
tree | 02a6a08cdfd06178401e7ac58d2f24fe8a595667 /qapi/block-core.json | |
parent | 456e75171a85c19a5bfa202eefcbdc4ef1692f05 (diff) | |
download | qemu-a2085f8909377b6df738f6c3f7ee6db4d16da8f7.zip qemu-a2085f8909377b6df738f6c3f7ee6db4d16da8f7.tar.gz qemu-a2085f8909377b6df738f6c3f7ee6db4d16da8f7.tar.bz2 |
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>
Diffstat (limited to 'qapi/block-core.json')
-rw-r--r-- | qapi/block-core.json | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/qapi/block-core.json b/qapi/block-core.json index 4b93651..7720da0 100644 --- a/qapi/block-core.json +++ b/qapi/block-core.json @@ -251,7 +251,7 @@ } } ## -# @ImageInfo: +# @BlockNodeInfo: # # Information about a QEMU image file # @@ -279,23 +279,35 @@ # # @snapshots: list of VM snapshots # -# @backing-image: info of the backing image (since 1.6) -# # @format-specific: structure supplying additional format-specific # information (since 1.7) # -# Since: 1.3 +# Since: 8.0 ## -{ 'struct': 'ImageInfo', +{ 'struct': 'BlockNodeInfo', 'data': {'filename': 'str', 'format': 'str', '*dirty-flag': 'bool', '*actual-size': 'int', 'virtual-size': 'int', '*cluster-size': 'int', '*encrypted': 'bool', '*compressed': 'bool', '*backing-filename': 'str', '*full-backing-filename': 'str', '*backing-filename-format': 'str', '*snapshots': ['SnapshotInfo'], - '*backing-image': 'ImageInfo', '*format-specific': 'ImageInfoSpecific' } } ## +# @ImageInfo: +# +# Information about a QEMU image file, and potentially its backing image +# +# @backing-image: info of the backing image +# +# Since: 1.3 +## +{ 'struct': 'ImageInfo', + 'base': 'BlockNodeInfo', + 'data': { + '*backing-image': 'ImageInfo' + } } + +## # @ImageCheck: # # Information about a QEMU image file check |