[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [Qemu-devel] [PATCH v4 2/5] vmdk: Implement .bdrv_co_cr
From: |
Markus Armbruster |
Subject: |
Re: [Qemu-block] [Qemu-devel] [PATCH v4 2/5] vmdk: Implement .bdrv_co_create callback |
Date: |
Fri, 07 Dec 2018 14:01:30 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) |
Kevin Wolf <address@hidden> writes:
> From: Fam Zheng <address@hidden>
>
> This makes VMDK support blockdev-create. The implementation reuses the
> image creation code in vmdk_co_create_opts which now acceptes a callback
> pointer to "retrieve" BlockBackend pointers from the caller. This way we
> separate the logic between file/extent acquisition and initialization.
>
> The QAPI command parameters are mostly the same as the old create_opts
> except the dropped legacy @compat6 switch, which is redundant with
> @hwversion.
>
> Signed-off-by: Fam Zheng <address@hidden>
> Signed-off-by: Kevin Wolf <address@hidden>
> ---
> qapi/block-core.json | 70 +++++++
> qapi/qapi-schema.json | 16 +-
> block/vmdk.c | 448 ++++++++++++++++++++++++++++++------------
> 3 files changed, 400 insertions(+), 134 deletions(-)
>
> diff --git a/qapi/block-core.json b/qapi/block-core.json
> index d4fe710836..0793550cf2 100644
> --- a/qapi/block-core.json
> +++ b/qapi/block-core.json
> @@ -4021,6 +4021,75 @@
> 'size': 'size',
> '*cluster-size' : 'size' } }
>
> +##
> +# @BlockdevVmdkSubformat:
> +#
> +# Subformat options for VMDK images
> +#
> +# @monolithicSparse: Single file image with sparse cluster allocation
> +#
> +# @monolithicFlat: Single flat data image and a descriptor file
> +#
> +# @twoGbMaxExtentSparse: Data is split into 2GB (per virtual LBA) sparse
> extent
> +# files, in addition to a descriptor file
> +#
> +# @twoGbMaxExtentFlat: Data is split into 2GB (per virtual LBA) flat extent
> +# files, in addition to a descriptor file
> +#
> +# @streamOptimized: Single file image sparse cluster allocation,
> optimized
> +# for streaming over network.
> +#
> +# Since: 4.0
> +##
> +{ 'enum': 'BlockdevVmdkSubformat',
> + 'data': [ 'monolithicSparse', 'monolithicFlat', 'twoGbMaxExtentSparse',
> + 'twoGbMaxExtentFlat', 'streamOptimized'] }
> +
> +##
> +# @BlockdevVmdkAdapterType:
> +#
> +# Adapter type info for VMDK images
> +#
> +# Since: 4.0
> +##
> +{ 'enum': 'BlockdevVmdkAdapterType',
> + 'data': [ 'ide', 'buslogic', 'lsilogic', 'legacyESX'] }
> +
> +##
> +# @BlockdevCreateOptionsVmdk:
> +#
> +# Driver specific image creation options for VMDK.
> +#
> +# @file Where to store the new image file. This refers to the image
> +# file for monolithcSparse and streamOptimized format, or the
> +# descriptor file for other formats.
> +# @size Size of the virtual disk in bytes
> +# @extents Where to store the data extents. Required for monolithcFlat,
> +# twoGbMaxExtentSparse and twoGbMaxExtentFlat formats. For
> +# monolithicFlat, only one entry is required; for
> +# twoGbMaxExtent* formats, the number of entries required is
> +# calculated as extent_number = virtual_size / 2GB.
Doesn't quite spell out that the number of extents has to match
exactly. I'm not sure I care.
> +# @subformat The subformat of the VMDK image. Default: "monolithicSparse".
> +# @backing-file The path of backing file. Default: no backing file is used.
> +# @adapter-type The adapter type used to fill in the descriptor. Default:
> ide.
> +# @hwversion Hardware version. The meaningful options are "4" or "6".
> +# Default: "4".
> +# @zeroed-grain Whether to enable zeroed-grain feature for sparse subformats.
> +# Default: false.
> +#
> +# Since: 4.0
> +##
> +{ 'struct': 'BlockdevCreateOptionsVmdk',
> + 'data': { 'file': 'BlockdevRef',
> + 'size': 'size',
> + '*extents': ['BlockdevRef'],
> + '*subformat': 'BlockdevVmdkSubformat',
> + '*backing-file': 'str',
> + '*adapter-type': 'BlockdevVmdkAdapterType',
> + '*hwversion': 'str',
> + '*zeroed-grain': 'bool' } }
> +
> +
> ##
> # @SheepdogRedundancyType:
> #
> @@ -4215,6 +4284,7 @@
> 'ssh': 'BlockdevCreateOptionsSsh',
> 'vdi': 'BlockdevCreateOptionsVdi',
> 'vhdx': 'BlockdevCreateOptionsVhdx',
> + 'vmdk': 'BlockdevCreateOptionsVmdk',
> 'vpc': 'BlockdevCreateOptionsVpc'
> } }
>
[...]
Reviewed-by: Markus Armbruster <address@hidden>
- [Qemu-block] [PATCH v4 0/5] vmdk: Implement blockdev-create, Kevin Wolf, 2018/12/07
- [Qemu-block] [PATCH v4 1/5] vmdk: Refactor vmdk_create_extent, Kevin Wolf, 2018/12/07
- [Qemu-block] [PATCH v4 2/5] vmdk: Implement .bdrv_co_create callback, Kevin Wolf, 2018/12/07
- Re: [Qemu-block] [Qemu-devel] [PATCH v4 2/5] vmdk: Implement .bdrv_co_create callback,
Markus Armbruster <=
- [Qemu-block] [PATCH v4 3/5] iotests: Filter cid numbers in VMDK extent info, Kevin Wolf, 2018/12/07
- [Qemu-block] [PATCH v4 4/5] iotests: Add VMDK tests for blockdev-create, Kevin Wolf, 2018/12/07
- Re: [Qemu-block] [Qemu-devel] [PATCH v4 4/5] iotests: Add VMDK tests for blockdev-create, Markus Armbruster, 2018/12/07
- Re: [Qemu-block] [Qemu-devel] [PATCH v4 4/5] iotests: Add VMDK tests for blockdev-create, Markus Armbruster, 2018/12/07
- Re: [Qemu-block] [Qemu-devel] [PATCH v4 4/5] iotests: Add VMDK tests for blockdev-create, Kevin Wolf, 2018/12/07
- Re: [Qemu-block] [Qemu-devel] [PATCH v4 4/5] iotests: Add VMDK tests for blockdev-create, Eric Blake, 2018/12/07
- Re: [Qemu-block] [Qemu-devel] [PATCH v4 4/5] iotests: Add VMDK tests for blockdev-create, Kevin Wolf, 2018/12/07
- Re: [Qemu-block] [Qemu-devel] [PATCH v4 4/5] iotests: Add VMDK tests for blockdev-create, Eric Blake, 2018/12/07
- Re: [Qemu-block] [Qemu-devel] [PATCH v4 4/5] iotests: Add VMDK tests for blockdev-create, Kevin Wolf, 2018/12/07