qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] block/qcow2: Use bdrv_truncate for size amend


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCH] block/qcow2: Use bdrv_truncate for size amend
Date: Wed, 2 Oct 2013 14:32:04 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

On Mon, Sep 09, 2013 at 12:17:41PM +0200, Max Reitz wrote:
> When amending the size option for a qcow2 image, use bdrv_truncate
> instead of qcow2_truncate directly, since the latter will not adjust the
> total_sectors count in the BDS structure (whereas the former will).
> 
> Signed-off-by: Max Reitz <address@hidden>
> ---
> Depends on (follow-up to):
>  - block/qcow2: Image file option amendment (series, v5)
> ---
>  block/qcow2.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/block/qcow2.c b/block/qcow2.c
> index d29547b..259edfd 100644
> --- a/block/qcow2.c
> +++ b/block/qcow2.c
> @@ -1997,7 +1997,7 @@ static int qcow2_amend_options(BlockDriverState *bs,
>      }
>  
>      if (new_size) {
> -        ret = qcow2_truncate(bs, new_size);
> +        ret = bdrv_truncate(bs, new_size);
>          if (ret < 0) {
>              return ret;
>          }

It seems this patch was already squashed into
9296b3ed7050cc6e0645fbc3b0aea74406d7eeb2 ("qcow2: Implement
bdrv_amend_options").



reply via email to

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