[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL 19/23] qcow2: Explicit number replaced by a constant
From: |
Kevin Wolf |
Subject: |
[Qemu-block] [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-block] [PULL 00/23] Block layer patches, Kevin Wolf, 2018/10/01
- [Qemu-block] [PULL 02/23] qemu-io: Fix writethrough check in reopen, Kevin Wolf, 2018/10/01
- [Qemu-block] [PULL 01/23] file-posix: Include filename in locking error message, Kevin Wolf, 2018/10/01
- [Qemu-block] [PULL 03/23] file-posix: x-check-cache-dropped should default to false on reopen, Kevin Wolf, 2018/10/01
- [Qemu-block] [PULL 04/23] block: Remove child references from bs->{options, explicit_options}, Kevin Wolf, 2018/10/01
- [Qemu-block] [PULL 06/23] block: Allow child references on reopen, Kevin Wolf, 2018/10/01
- [Qemu-block] [PULL 07/23] block: Forbid trying to change unsupported options during reopen, Kevin Wolf, 2018/10/01
- [Qemu-block] [PULL 05/23] block: Don't look for child references in append_open_options(), Kevin Wolf, 2018/10/01
- [Qemu-block] [PULL 10/23] block: Allow changing 'detect-zeroes' on reopen, Kevin Wolf, 2018/10/01
- [Qemu-block] [PULL 09/23] block: Allow changing 'discard' on reopen, Kevin Wolf, 2018/10/01
- [Qemu-block] [PULL 19/23] qcow2: Explicit number replaced by a constant,
Kevin Wolf <=
- [Qemu-block] [PULL 12/23] include: Add a lookup table of sizes, Kevin Wolf, 2018/10/01
- [Qemu-block] [PULL 16/23] qcow2: Increase the default upper limit on the L2 cache size, Kevin Wolf, 2018/10/01
- [Qemu-block] [PULL 17/23] qcow2: Resize the cache upon image resizing, Kevin Wolf, 2018/10/01
- [Qemu-block] [PULL 20/23] block-backend: Set werror/rerror defaults in blk_new(), Kevin Wolf, 2018/10/01
- [Qemu-block] [PULL 21/23] qcow2: Fix cache-clean-interval documentation, Kevin Wolf, 2018/10/01
- [Qemu-block] [PULL 22/23] test-replication: Lock AioContext around blk_unref(), Kevin Wolf, 2018/10/01
- [Qemu-block] [PULL 08/23] file-posix: Forbid trying to change unsupported options during reopen, Kevin Wolf, 2018/10/01