[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 7/7] iotests: Fix 176 on 32-bit host
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PULL 7/7] iotests: Fix 176 on 32-bit host |
Date: |
Tue, 21 Nov 2017 16:10:17 +0100 |
From: Eric Blake <address@hidden>
The contents of a qcow2 bitmap are rounded up to a size that
matches the number of bits available for the granularity, but
that granularity differs for 32-bit hosts (our default 64k
cluster allows for 2M bitmap coverage per 'long') and 64-bit
hosts (4M bitmap per 'long'). If the image is a multiple of
2M but not 4M, then the number of bytes occupied by the array
of longs in memory differs between architecture, thus
resulting in different SHA256 hashes.
Furthermore (but untested by me), if our computation of the
SHA256 hash is at all endian-dependent because of how we store
data in memory, that's another variable we'd have to account
for (ideally, we specified the bitmap stored in qcow2 as
fixed-endian on disk, because the same qcow2 file must be
usable across any architecture; but that says nothing about
how we represent things in memory). But we already have test
165 to validate that bitmaps are stored correctly on disk,
while this test is merely testing that the bitmap exists.
So for this test, the easiest solution is to filter out the
actual hash value. Broken in commit 4096974e.
Reported-by: Max Reitz <address@hidden>
Signed-off-by: Eric Blake <address@hidden>
Message-id: address@hidden
Reviewed-by: John Snow <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Signed-off-by: Max Reitz <address@hidden>
---
tests/qemu-iotests/176 | 3 ++-
tests/qemu-iotests/176.out | 8 ++++----
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/tests/qemu-iotests/176 b/tests/qemu-iotests/176
index 0f31a20294..b8dc17c592 100755
--- a/tests/qemu-iotests/176
+++ b/tests/qemu-iotests/176
@@ -52,7 +52,8 @@ _supported_os Linux
function run_qemu()
{
$QEMU -nographic -qmp stdio -serial none "$@" 2>&1 \
- | _filter_testdir | _filter_qmp | _filter_qemu
+ | _filter_testdir | _filter_qmp | _filter_qemu \
+ | sed 's/"sha256": ".\{64\}"/"sha256": HASH/'
}
for reason in snapshot bitmap; do
diff --git a/tests/qemu-iotests/176.out b/tests/qemu-iotests/176.out
index e62085cd0a..f03a2e776c 100644
--- a/tests/qemu-iotests/176.out
+++ b/tests/qemu-iotests/176.out
@@ -205,7 +205,7 @@ Offset Length File
QMP_VERSION
{"return": {}}
{"return": {}}
-{"return": {"sha256":
"e12600978d86b5a453861ae5c17d275204673fef3874b7c3c5433c6153d84706"}}
+{"return": {"sha256": HASH}}
{"return": {}}
{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event":
"SHUTDOWN", "data": {"guest": false}}
@@ -255,7 +255,7 @@ Offset Length File
QMP_VERSION
{"return": {}}
{"return": {}}
-{"return": {"sha256":
"e12600978d86b5a453861ae5c17d275204673fef3874b7c3c5433c6153d84706"}}
+{"return": {"sha256": HASH}}
{"return": {}}
{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event":
"SHUTDOWN", "data": {"guest": false}}
@@ -305,7 +305,7 @@ Offset Length File
QMP_VERSION
{"return": {}}
{"return": {}}
-{"return": {"sha256":
"e12600978d86b5a453861ae5c17d275204673fef3874b7c3c5433c6153d84706"}}
+{"return": {"sha256": HASH}}
{"return": {}}
{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event":
"SHUTDOWN", "data": {"guest": false}}
@@ -352,7 +352,7 @@ Offset Length File
QMP_VERSION
{"return": {}}
{"return": {}}
-{"return": {"sha256":
"e12600978d86b5a453861ae5c17d275204673fef3874b7c3c5433c6153d84706"}}
+{"return": {"sha256": HASH}}
{"return": {}}
{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event":
"SHUTDOWN", "data": {"guest": false}}
*** done
--
2.13.6
- [Qemu-devel] [PULL 0/7] Block layer patches for 2.11.0-rc2, Kevin Wolf, 2017/11/21
- [Qemu-devel] [PULL 1/7] block: Don't use BLK_PERM_CONSISTENT_READ for format probing, Kevin Wolf, 2017/11/21
- [Qemu-devel] [PULL 2/7] block: Don't request I/O permission with BDRV_O_NO_IO, Kevin Wolf, 2017/11/21
- [Qemu-devel] [PULL 4/7] block: Add errp to bdrv_all_goto_snapshot(), Kevin Wolf, 2017/11/21
- [Qemu-devel] [PULL 3/7] block: Add errp to bdrv_snapshot_goto(), Kevin Wolf, 2017/11/21
- [Qemu-devel] [PULL 6/7] block: Close a BlockDriverState completely even when bs->drv is NULL, Kevin Wolf, 2017/11/21
- [Qemu-devel] [PULL 5/7] block: Error out on load_vm with active dirty bitmaps, Kevin Wolf, 2017/11/21
- [Qemu-devel] [PULL 7/7] iotests: Fix 176 on 32-bit host,
Kevin Wolf <=
- Re: [Qemu-devel] [PULL 0/7] Block layer patches for 2.11.0-rc2, Peter Maydell, 2017/11/21