mirror of
https://github.com/Motorhead1991/qemu.git
synced 2026-02-11 03:19:28 -07:00
block/vmdk: Change extent info type
VMDK's implementation of .bdrv_get_specific_info() returns information
about its extent files, ostensibly in the form of ImageInfo objects.
However, it does not get this information through
bdrv_query_image_info(), but fills only a select few fields with custom
information that does not always match the fields' purposes.
For example, @format, which is supposed to be a block driver name, is
filled with the extent type, e.g. SPARSE or FLAT.
In ImageInfo, @compressed shows whether the data that can be seen in the
image is stored in compressed form or not. For example, a compressed
qcow2 image will store compressed data in its data file, but when
accessing the qcow2 node, you will see normal data. This is not how
VMDK uses the @compressed field for its extent files: Instead, it
signifies whether accessing the extent file will yield compressed data
(which the VMDK driver then (de-)compresses).
Create a new structure to represent the extent information. This allows
us to clarify the fields' meanings, and it clearly shows that these are
not complete ImageInfo objects. (That is, if a user wants an extent
file's ImageInfo object, they will need to query it separately, and will
not get it from ImageInfoSpecificVmdk.extents.)
Note that this removes the last use of ['ImageInfo'] (i.e. an array of
ImageInfo objects), so the QAPI generator will no longer generate
ImageInfoList by default. However, we use it in qemu-img.c, so we need
to create a dummy object to force the generate to create that type,
similarly to DummyForceArrays in machine.json (introduced in commit
9f08c8ec73 ("qapi: Lazy creation of array
types")).
Signed-off-by: Hanna Reitz <hreitz@redhat.com>
Message-Id: <20220620162704.80987-4-hreitz@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
7f36a50ab4
commit
456e75171a
2 changed files with 41 additions and 5 deletions
|
|
@ -124,7 +124,33 @@
|
|||
'create-type': 'str',
|
||||
'cid': 'int',
|
||||
'parent-cid': 'int',
|
||||
'extents': ['ImageInfo']
|
||||
'extents': ['VmdkExtentInfo']
|
||||
} }
|
||||
|
||||
##
|
||||
# @VmdkExtentInfo:
|
||||
#
|
||||
# Information about a VMDK extent file
|
||||
#
|
||||
# @filename: Name of the extent file
|
||||
#
|
||||
# @format: Extent type (e.g. FLAT or SPARSE)
|
||||
#
|
||||
# @virtual-size: Number of bytes covered by this extent
|
||||
#
|
||||
# @cluster-size: Cluster size in bytes (for non-flat extents)
|
||||
#
|
||||
# @compressed: Whether this extent contains compressed data
|
||||
#
|
||||
# Since: 8.0
|
||||
##
|
||||
{ 'struct': 'VmdkExtentInfo',
|
||||
'data': {
|
||||
'filename': 'str',
|
||||
'format': 'str',
|
||||
'virtual-size': 'int',
|
||||
'*cluster-size': 'int',
|
||||
'*compressed': 'bool'
|
||||
} }
|
||||
|
||||
##
|
||||
|
|
@ -5754,3 +5780,13 @@
|
|||
'data': { 'device': 'str', '*id': 'str', '*name': 'str'},
|
||||
'returns': 'SnapshotInfo',
|
||||
'allow-preconfig': true }
|
||||
|
||||
##
|
||||
# @DummyBlockCoreForceArrays:
|
||||
#
|
||||
# Not used by QMP; hack to let us use ImageInfoList internally
|
||||
#
|
||||
# Since: 8.0
|
||||
##
|
||||
{ 'struct': 'DummyBlockCoreForceArrays',
|
||||
'data': { 'unused-image-info': ['ImageInfo'] } }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue