[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [PATCH v2 6/8] vhdx: Support .bdrv_co_create
From: |
Max Reitz |
Subject: |
Re: [Qemu-block] [PATCH v2 6/8] vhdx: Support .bdrv_co_create |
Date: |
Tue, 13 Mar 2018 15:59:38 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 |
On 2018-03-13 15:47, Kevin Wolf wrote:
> This adds the .bdrv_co_create driver callback to vhdx, which
> enables image creation over QMP.
>
> Signed-off-by: Kevin Wolf <address@hidden>
> ---
> qapi/block-core.json | 40 +++++++++-
> block/vhdx.c | 216
> ++++++++++++++++++++++++++++++++++++++-------------
> 2 files changed, 203 insertions(+), 53 deletions(-)
Reviewed-by: Max Reitz <address@hidden>
> diff --git a/block/vhdx.c b/block/vhdx.c
> index d82350d07c..f1b97f4b49 100644
> --- a/block/vhdx.c
> +++ b/block/vhdx.c
[...]
> @@ -1792,59 +1797,71 @@ exit:
> * .---- ~ ----------- ~ ------------ ~ ---------------- ~ -----------.
> * 1MB
> */
> -static int coroutine_fn vhdx_co_create_opts(const char *filename, QemuOpts
> *opts,
> - Error **errp)
> +static int coroutine_fn vhdx_co_create(BlockdevCreateOptions *opts,
> + Error **errp)
> {
[...]
> /* These are pretty arbitrary, and mainly designed to keep the BAT
> * size reasonable to load into RAM */
> - if (block_size == 0) {
> + if (vhdx_opts->has_block_size) {
> + block_size = vhdx_opts->block_size;
> + } else {
Ah, good. I have to admit I was a bit worried you'd keep the special
meaning of cluster_size == 0.
Max
> if (image_size > 32 * TiB) {
> block_size = 64 * MiB;
> } else if (image_size > (uint64_t) 100 * GiB) {
signature.asc
Description: OpenPGP digital signature
- [Qemu-block] [PATCH v2 1/8] parallels: Support .bdrv_co_create, (continued)
- [Qemu-block] [PATCH v2 1/8] parallels: Support .bdrv_co_create, Kevin Wolf, 2018/03/13
- [Qemu-block] [PATCH v2 5/8] vdi: Make comments consistent with other drivers, Kevin Wolf, 2018/03/13
- [Qemu-block] [PATCH v2 3/8] qcow: Support .bdrv_co_create, Kevin Wolf, 2018/03/13
- [Qemu-block] [PATCH v2 4/8] qed: Support .bdrv_co_create, Kevin Wolf, 2018/03/13
- [Qemu-block] [PATCH v2 7/8] vpc: Support .bdrv_co_create, Kevin Wolf, 2018/03/13
- [Qemu-block] [PATCH v2 8/8] vpc: Require aligned size in .bdrv_co_create, Kevin Wolf, 2018/03/13
- [Qemu-block] [PATCH v2 6/8] vhdx: Support .bdrv_co_create, Kevin Wolf, 2018/03/13
- Re: [Qemu-block] [PATCH v2 6/8] vhdx: Support .bdrv_co_create,
Max Reitz <=
- Re: [Qemu-block] [PATCH v2 0/8] block: .bdrv_co_create for format drivers, Kevin Wolf, 2018/03/13