[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v4 08/10] block: Drop superfluous aligning of bdrv_g
From: |
Markus Armbruster |
Subject: |
[Qemu-devel] [PATCH v4 08/10] block: Drop superfluous aligning of bdrv_getlength()'s value |
Date: |
Wed, 4 Jun 2014 13:51:49 +0200 |
It returns a multiple of the sector size.
Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Reviewed-by: Benoit Canet <address@hidden>
---
block.c | 1 -
block/qcow2.c | 1 -
2 files changed, 2 deletions(-)
diff --git a/block.c b/block.c
index ee007c2..cae9085 100644
--- a/block.c
+++ b/block.c
@@ -1261,7 +1261,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 1f15adf..1cfcb63 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -1926,7 +1926,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
- [Qemu-devel] [PATCH v4 00/10] Clean up around bdrv_getlength(), Markus Armbruster, 2014/06/04
- [Qemu-devel] [PATCH v4 03/10] block: Use bdrv_nb_sectors() in bdrv_make_zero(), Markus Armbruster, 2014/06/04
- [Qemu-devel] [PATCH v4 04/10] block: Use bdrv_nb_sectors() in bdrv_aligned_preadv(), Markus Armbruster, 2014/06/04
- [Qemu-devel] [PATCH v4 05/10] block: Use bdrv_nb_sectors() in bdrv_co_get_block_status(), Markus Armbruster, 2014/06/04
- [Qemu-devel] [PATCH v4 02/10] block: New bdrv_nb_sectors(), Markus Armbruster, 2014/06/04
- [Qemu-devel] [PATCH v4 06/10] block: Use bdrv_nb_sectors() in img_convert(), Markus Armbruster, 2014/06/04
- [Qemu-devel] [PATCH v4 08/10] block: Drop superfluous aligning of bdrv_getlength()'s value,
Markus Armbruster <=
- [Qemu-devel] [PATCH v4 09/10] qemu-img: Make img_convert() get image size just once per image, Markus Armbruster, 2014/06/04
- [Qemu-devel] [PATCH v4 01/10] raw-posix: Fix raw_getlength() to always return -errno on error, Markus Armbruster, 2014/06/04
- [Qemu-devel] [PATCH v4 07/10] block: Use bdrv_nb_sectors() where sectors, not bytes are wanted, Markus Armbruster, 2014/06/04
- [Qemu-devel] [PATCH v4 10/10] block: Avoid bdrv_get_geometry() where errors should be detected, Markus Armbruster, 2014/06/04
- Re: [Qemu-devel] [PATCH v4 10/10] block: Avoid bdrv_get_geometry() where errors should be detected, Benoît Canet, 2014/06/04