summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorLeonid Bloch <lbloch@janustech.com>2018-09-26 19:04:47 +0300
committerKevin Wolf <kwolf@redhat.com>2018-10-01 12:51:12 +0200
commitbd016b912cc68c6f6c68cd5acb2e13126bd9e05c (patch)
treeb4579acddf8eb1b69c6aef01972d64db8b32ff76
parente957b50b8daecfc39a1ac09855b0eacb6edfd328 (diff)
downloadfocaccia-qemu-bd016b912cc68c6f6c68cd5acb2e13126bd9e05c.tar.gz
focaccia-qemu-bd016b912cc68c6f6c68cd5acb2e13126bd9e05c.zip
qcow2: Explicit number replaced by a constant
Signed-off-by: Leonid Bloch <lbloch@janustech.com>
Reviewed-by: Alberto Garcia <berto@igalia.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
-rw-r--r--block/qcow2.c4
1 files 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) {