[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 19/23] qcow2: Explicit number replaced by a constant
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PULL 19/23] qcow2: Explicit number replaced by a constant |
Date: |
Mon, 1 Oct 2018 19:18:57 +0200 |
From: Leonid Bloch <address@hidden>
Signed-off-by: Leonid Bloch <address@hidden>
Reviewed-by: Alberto Garcia <address@hidden>
Reviewed-by: Kevin Wolf <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
block/qcow2.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/block/qcow2.c b/block/qcow2.c
index 95e1c98daa..7277feda13 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -1324,7 +1324,7 @@ static int coroutine_fn qcow2_do_open(BlockDriverState
*bs, QDict *options,
/* 2^(s->refcount_order - 3) is the refcount width in bytes */
s->refcount_block_bits = s->cluster_bits - (s->refcount_order - 3);
s->refcount_block_size = 1 << s->refcount_block_bits;
- bs->total_sectors = header.size / 512;
+ bs->total_sectors = header.size / BDRV_SECTOR_SIZE;
s->csize_shift = (62 - (s->cluster_bits - 8));
s->csize_mask = (1 << (s->cluster_bits - 8)) - 1;
s->cluster_offset_mask = (1LL << s->csize_shift) - 1;
@@ -3450,7 +3450,7 @@ static int coroutine_fn
qcow2_co_truncate(BlockDriverState *bs, int64_t offset,
goto fail;
}
- old_length = bs->total_sectors * 512;
+ old_length = bs->total_sectors * BDRV_SECTOR_SIZE;
new_l1_size = size_to_l1(s, offset);
if (offset < old_length) {
--
2.13.6
- [Qemu-devel] [PULL 05/23] block: Don't look for child references in append_open_options(), (continued)
- [Qemu-devel] [PULL 17/23] qcow2: Resize the cache upon image resizing, Kevin Wolf, 2018/10/01
- [Qemu-devel] [PULL 19/23] qcow2: Explicit number replaced by a constant,
Kevin Wolf <=
- [Qemu-devel] [PULL 14/23] qcow2: Avoid duplication in setting the refcount cache size, Kevin Wolf, 2018/10/01
- [Qemu-devel] [PULL 18/23] qcow2: Set the default cache-clean-interval to 10 minutes, Kevin Wolf, 2018/10/01
- [Qemu-devel] [PULL 11/23] qcow2: Options' documentation fixes, Kevin Wolf, 2018/10/01
- [Qemu-devel] [PULL 20/23] block-backend: Set werror/rerror defaults in blk_new(), Kevin Wolf, 2018/10/01
- [Qemu-devel] [PULL 13/23] qcow2: Make sizes more humanly readable, Kevin Wolf, 2018/10/01
- [Qemu-devel] [PULL 12/23] include: Add a lookup table of sizes, Kevin Wolf, 2018/10/01
- [Qemu-devel] [PULL 21/23] qcow2: Fix cache-clean-interval documentation, Kevin Wolf, 2018/10/01
- [Qemu-devel] [PULL 16/23] qcow2: Increase the default upper limit on the L2 cache size, Kevin Wolf, 2018/10/01
- [Qemu-devel] [PULL 23/23] tests/test-bdrv-drain: Fix too late qemu_event_reset(), Kevin Wolf, 2018/10/01
- [Qemu-devel] [PULL 22/23] test-replication: Lock AioContext around blk_unref(), Kevin Wolf, 2018/10/01