From: Markus Armbruster Date: Thu, 26 Jun 2014 11:23:23 +0000 (+0200) Subject: block: Drop superfluous aligning of bdrv_getlength()'s value X-Git-Tag: v2.2.0-rc0~177^2~52 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=75d3d21;p=thirdparty%2Fqemu.git block: Drop superfluous aligning of bdrv_getlength()'s value It returns a multiple of the sector size. Signed-off-by: Markus Armbruster Reviewed-by: Max Reitz Reviewed-by: Benoit Canet Signed-off-by: Stefan Hajnoczi --- diff --git a/block.c b/block.c index 2fcc2f738a9..1af74e601b4 100644 --- a/block.c +++ b/block.c @@ -1314,7 +1314,6 @@ int bdrv_append_temp_snapshot(BlockDriverState *bs, int flags, 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 ad93824c6cf..964ab93b088 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -1947,7 +1947,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; }