qemu-block
[Top][All Lists]
Advanced

[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) {

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]