qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 4/5] block: Drop superfluous aligning of bdrv_ge


From: Kevin Wolf
Subject: Re: [Qemu-devel] [PATCH 4/5] block: Drop superfluous aligning of bdrv_getlength()'s value
Date: Wed, 28 May 2014 12:04:49 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

Am 09.05.2014 um 11:48 hat Markus Armbruster geschrieben:
> It returns a multiple of the sector size.
> 
> Signed-off-by: Markus Armbruster <address@hidden>

Sooner or later this will change. If we do want to remove the rounding,
how about adding an assertion instead so that we find those places at
least when bdrv_getlength() is changed to byte granularity?

Kevin

>  block.c       | 1 -
>  block/qcow2.c | 1 -
>  2 files changed, 2 deletions(-)
> 
> diff --git a/block.c b/block.c
> index 1b99cb1..89cab7c 100644
> --- a/block.c
> +++ b/block.c
> @@ -1228,7 +1228,6 @@ void bdrv_append_temp_snapshot(BlockDriverState *bs, 
> Error **errp)
>          error_setg_errno(errp, -total_size, "Could not get image size");
>          goto out;
>      }
> -    total_size &= BDRV_SECTOR_MASK;
>  
>      /* Create the temporary image */
>      ret = get_tmp_filename(tmp_filename, PATH_MAX + 1);
> diff --git a/block/qcow2.c b/block/qcow2.c
> index 98f624c..4af09bd 100644
> --- a/block/qcow2.c
> +++ b/block/qcow2.c
> @@ -1927,7 +1927,6 @@ static int qcow2_write_compressed(BlockDriverState *bs, 
> int64_t sector_num,
>          /* align end of file to a sector boundary to ease reading with
>             sector based I/Os */
>          cluster_offset = bdrv_getlength(bs->file);
> -        cluster_offset = (cluster_offset + 511) & ~511;
>          bdrv_truncate(bs->file, cluster_offset);
>          return 0;
>      }
> -- 
> 1.8.1.4
> 



reply via email to

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