It returns a multiple of the sector size. Signed-off-by: Markus Armbruster <arm...@redhat.com> Reviewed-by: Max Reitz <mre...@redhat.com> Reviewed-by: Benoit Canet <ben...@irqsave.net> --- block.c | 1 - block/qcow2.c | 1 - 2 files changed, 2 deletions(-)
diff --git a/block.c b/block.c index a527740..36f3315 100644 --- a/block.c +++ b/block.c @@ -1262,7 +1262,6 @@ void 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 7b85fad..b452b5f 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -1929,7 +1929,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.9.3