|
|
7711c0 |
From 01cb24169e6f707daea28e19dbb9cbc59180023c Mon Sep 17 00:00:00 2001
|
|
|
7711c0 |
From: Kevin Wolf <kwolf@redhat.com>
|
|
|
7711c0 |
Date: Tue, 19 Feb 2019 17:00:22 +0100
|
|
|
7711c0 |
Subject: [PATCH 21/23] qcow2: Explicit number replaced by a constant
|
|
|
7711c0 |
|
|
|
7711c0 |
RH-Author: Kevin Wolf <kwolf@redhat.com>
|
|
|
7711c0 |
Message-id: <20190219170023.27826-13-kwolf@redhat.com>
|
|
|
7711c0 |
Patchwork-id: 84551
|
|
|
7711c0 |
O-Subject: [RHEL-7.7 qemu-kvm-rhev PATCH 12/13] qcow2: Explicit number replaced by a constant
|
|
|
7711c0 |
Bugzilla: 1656913
|
|
|
7711c0 |
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
|
|
|
7711c0 |
RH-Acked-by: Max Reitz <mreitz@redhat.com>
|
|
|
7711c0 |
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
7711c0 |
|
|
|
7711c0 |
From: Leonid Bloch <lbloch@janustech.com>
|
|
|
7711c0 |
|
|
|
7711c0 |
Signed-off-by: Leonid Bloch <lbloch@janustech.com>
|
|
|
7711c0 |
Reviewed-by: Alberto Garcia <berto@igalia.com>
|
|
|
7711c0 |
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
|
|
|
7711c0 |
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
|
|
|
7711c0 |
(cherry picked from commit bd016b912cc68c6f6c68cd5acb2e13126bd9e05c)
|
|
|
7711c0 |
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
|
|
|
7711c0 |
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
7711c0 |
---
|
|
|
7711c0 |
block/qcow2.c | 4 ++--
|
|
|
7711c0 |
1 file changed, 2 insertions(+), 2 deletions(-)
|
|
|
7711c0 |
|
|
|
7711c0 |
diff --git a/block/qcow2.c b/block/qcow2.c
|
|
|
7711c0 |
index acd076c..114dcdd 100644
|
|
|
7711c0 |
--- a/block/qcow2.c
|
|
|
7711c0 |
+++ b/block/qcow2.c
|
|
|
7711c0 |
@@ -1321,7 +1321,7 @@ static int coroutine_fn qcow2_do_open(BlockDriverState *bs, QDict *options,
|
|
|
7711c0 |
/* 2^(s->refcount_order - 3) is the refcount width in bytes */
|
|
|
7711c0 |
s->refcount_block_bits = s->cluster_bits - (s->refcount_order - 3);
|
|
|
7711c0 |
s->refcount_block_size = 1 << s->refcount_block_bits;
|
|
|
7711c0 |
- bs->total_sectors = header.size / 512;
|
|
|
7711c0 |
+ bs->total_sectors = header.size / BDRV_SECTOR_SIZE;
|
|
|
7711c0 |
s->csize_shift = (62 - (s->cluster_bits - 8));
|
|
|
7711c0 |
s->csize_mask = (1 << (s->cluster_bits - 8)) - 1;
|
|
|
7711c0 |
s->cluster_offset_mask = (1LL << s->csize_shift) - 1;
|
|
|
7711c0 |
@@ -3494,7 +3494,7 @@ static int coroutine_fn qcow2_co_truncate(BlockDriverState *bs, int64_t offset,
|
|
|
7711c0 |
goto fail;
|
|
|
7711c0 |
}
|
|
|
7711c0 |
|
|
|
7711c0 |
- old_length = bs->total_sectors * 512;
|
|
|
7711c0 |
+ old_length = bs->total_sectors * BDRV_SECTOR_SIZE;
|
|
|
7711c0 |
new_l1_size = size_to_l1(s, offset);
|
|
|
7711c0 |
|
|
|
7711c0 |
if (offset < old_length) {
|
|
|
7711c0 |
--
|
|
|
7711c0 |
1.8.3.1
|
|
|
7711c0 |
|