yeahuh / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone

Blame SOURCES/kvm-iotests-109-Don-t-mirror-with-mismatched-size.patch

ddf19c
From 2202321b549dda551190d919a5a1cbee0fab8c90 Mon Sep 17 00:00:00 2001
ddf19c
From: Kevin Wolf <kwolf@redhat.com>
ddf19c
Date: Wed, 3 Jun 2020 16:03:22 +0100
ddf19c
Subject: [PATCH 23/26] iotests/109: Don't mirror with mismatched size
ddf19c
ddf19c
RH-Author: Kevin Wolf <kwolf@redhat.com>
ddf19c
Message-id: <20200603160325.67506-9-kwolf@redhat.com>
ddf19c
Patchwork-id: 97105
ddf19c
O-Subject: [RHEL-AV-8.2.1 qemu-kvm PATCH v2 08/11] iotests/109: Don't mirror with mismatched size
ddf19c
Bugzilla: 1778593
ddf19c
RH-Acked-by: Eric Blake <eblake@redhat.com>
ddf19c
RH-Acked-by: Max Reitz <mreitz@redhat.com>
ddf19c
RH-Acked-by: Stefano Garzarella <sgarzare@redhat.com>
ddf19c
ddf19c
This patch makes the raw image the same size as the file in a different
ddf19c
format that is mirrored as raw to it to avoid errors when mirror starts
ddf19c
to enforce that source and target are the same size.
ddf19c
ddf19c
We check only that the first 512 bytes are zeroed (instead of 64k)
ddf19c
because some image formats create image files that are smaller than 64k,
ddf19c
so trying to read 64k would result in I/O errors. Apart from this, 512
ddf19c
is more appropriate anyway because the raw format driver protects
ddf19c
specifically the first 512 bytes.
ddf19c
ddf19c
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
ddf19c
Message-Id: <20200511135825.219437-2-kwolf@redhat.com>
ddf19c
Reviewed-by: Max Reitz <mreitz@redhat.com>
ddf19c
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
ddf19c
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
ddf19c
(cherry picked from commit ffa41a62d0b0e6d91f2071328befa046d56993e1)
ddf19c
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
ddf19c
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
ddf19c
---
ddf19c
 tests/qemu-iotests/109           | 10 +++---
ddf19c
 tests/qemu-iotests/109.out       | 74 +++++++++++++++++-----------------------
ddf19c
 tests/qemu-iotests/common.filter |  5 +++
ddf19c
 3 files changed, 41 insertions(+), 48 deletions(-)
ddf19c
ddf19c
diff --git a/tests/qemu-iotests/109 b/tests/qemu-iotests/109
ddf19c
index 9897ceb..190c35e 100755
ddf19c
--- a/tests/qemu-iotests/109
ddf19c
+++ b/tests/qemu-iotests/109
ddf19c
@@ -76,14 +76,14 @@ for fmt in qcow qcow2 qed vdi vmdk vpc; do
ddf19c
     echo "=== Writing a $fmt header into raw ==="
ddf19c
     echo
ddf19c
 
ddf19c
-    _make_test_img 64M
ddf19c
     TEST_IMG="$TEST_IMG.src" IMGFMT=$fmt _make_test_img 64M
ddf19c
+    _make_test_img $(du -b "$TEST_IMG.src" | cut -f1) | _filter_img_create_size
ddf19c
 
ddf19c
     # This first test should fail: The image format was probed, we may not
ddf19c
     # write an image header at the start of the image
ddf19c
     run_qemu "$TEST_IMG" "$TEST_IMG.src" "" "BLOCK_JOB_ERROR" |
ddf19c
         _filter_block_job_len
ddf19c
-    $QEMU_IO -c 'read -P 0 0 64k' "$TEST_IMG" | _filter_qemu_io
ddf19c
+    $QEMU_IO -c 'read -P 0 0 512' "$TEST_IMG" | _filter_qemu_io
ddf19c
 
ddf19c
 
ddf19c
     # When raw was explicitly specified, the same must succeed
ddf19c
@@ -102,12 +102,12 @@ for sample_img in empty.bochs iotest-dirtylog-10G-4M.vhdx parallels-v1 \
ddf19c
 
ddf19c
     # Can't use _use_sample_img because that isn't designed to be used multiple
ddf19c
     # times and it overwrites $TEST_IMG (both breaks cleanup)
ddf19c
-    _make_test_img 64M
ddf19c
     bzcat "$SAMPLE_IMG_DIR/$sample_img.bz2" > "$TEST_IMG.src"
ddf19c
+    _make_test_img $(du -b "$TEST_IMG.src" | cut -f1) | _filter_img_create_size
ddf19c
 
ddf19c
     run_qemu "$TEST_IMG" "$TEST_IMG.src" "" "BLOCK_JOB_ERROR" |
ddf19c
         _filter_block_job_offset | _filter_block_job_len
ddf19c
-    $QEMU_IO -c 'read -P 0 0 64k' "$TEST_IMG" | _filter_qemu_io
ddf19c
+    $QEMU_IO -c 'read -P 0 0 512' "$TEST_IMG" | _filter_qemu_io
ddf19c
 
ddf19c
     run_qemu "$TEST_IMG" "$TEST_IMG.src" "'format': 'raw'," "BLOCK_JOB_READY"
ddf19c
     $QEMU_IMG compare -f raw -F raw "$TEST_IMG" "$TEST_IMG.src"
ddf19c
@@ -118,8 +118,8 @@ echo "=== Write legitimate MBR into raw ==="
ddf19c
 echo
ddf19c
 
ddf19c
 for sample_img in grub_mbr.raw; do
ddf19c
-    _make_test_img 64M
ddf19c
     bzcat "$SAMPLE_IMG_DIR/$sample_img.bz2" > "$TEST_IMG.src"
ddf19c
+    _make_test_img $(du -b "$TEST_IMG.src" | cut -f1) | _filter_img_create_size
ddf19c
 
ddf19c
     run_qemu "$TEST_IMG" "$TEST_IMG.src" "" "BLOCK_JOB_READY"
ddf19c
     $QEMU_IMG compare -f raw -F raw "$TEST_IMG" "$TEST_IMG.src"
ddf19c
diff --git a/tests/qemu-iotests/109.out b/tests/qemu-iotests/109.out
ddf19c
index 884f65f..ad739df 100644
ddf19c
--- a/tests/qemu-iotests/109.out
ddf19c
+++ b/tests/qemu-iotests/109.out
ddf19c
@@ -2,8 +2,8 @@ QA output created by 109
ddf19c
 
ddf19c
 === Writing a qcow header into raw ===
ddf19c
 
ddf19c
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
ddf19c
 Formatting 'TEST_DIR/t.raw.src', fmt=IMGFMT size=67108864
ddf19c
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=SIZE
ddf19c
 { 'execute': 'qmp_capabilities' }
ddf19c
 {"return": {}}
ddf19c
 {'execute':'drive-mirror', 'arguments':{ 'device': 'src', 'target': 'TEST_DIR/t.IMGFMT', 'mode': 'existing', 'sync': 'full'}}
ddf19c
@@ -23,8 +23,8 @@ WARNING: Image format was not specified for 'TEST_DIR/t.raw' and probing guessed
ddf19c
 {"execute":"quit"}
ddf19c
 {"return": {}}
ddf19c
 {"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "SHUTDOWN", "data": {"guest": false, "reason": "host-qmp-quit"}}
ddf19c
-read 65536/65536 bytes at offset 0
ddf19c
-64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
ddf19c
+read 512/512 bytes at offset 0
ddf19c
+512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
ddf19c
 { 'execute': 'qmp_capabilities' }
ddf19c
 {"return": {}}
ddf19c
 {'execute':'drive-mirror', 'arguments':{ 'device': 'src', 'target': 'TEST_DIR/t.IMGFMT', 'format': 'IMGFMT', 'mode': 'existing', 'sync': 'full'}}
ddf19c
@@ -43,13 +43,12 @@ read 65536/65536 bytes at offset 0
ddf19c
 {"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "BLOCK_JOB_COMPLETED", "data": {"device": "src", "len": 1024, "offset": 1024, "speed": 0, "type": "mirror"}}
ddf19c
 {"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "JOB_STATUS_CHANGE", "data": {"status": "concluded", "id": "src"}}
ddf19c
 {"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "JOB_STATUS_CHANGE", "data": {"status": "null", "id": "src"}}
ddf19c
-Warning: Image size mismatch!
ddf19c
 Images are identical.
ddf19c
 
ddf19c
 === Writing a qcow2 header into raw ===
ddf19c
 
ddf19c
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
ddf19c
 Formatting 'TEST_DIR/t.raw.src', fmt=IMGFMT size=67108864
ddf19c
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=SIZE
ddf19c
 { 'execute': 'qmp_capabilities' }
ddf19c
 {"return": {}}
ddf19c
 {'execute':'drive-mirror', 'arguments':{ 'device': 'src', 'target': 'TEST_DIR/t.IMGFMT', 'mode': 'existing', 'sync': 'full'}}
ddf19c
@@ -69,8 +68,8 @@ WARNING: Image format was not specified for 'TEST_DIR/t.raw' and probing guessed
ddf19c
 {"execute":"quit"}
ddf19c
 {"return": {}}
ddf19c
 {"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "SHUTDOWN", "data": {"guest": false, "reason": "host-qmp-quit"}}
ddf19c
-read 65536/65536 bytes at offset 0
ddf19c
-64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
ddf19c
+read 512/512 bytes at offset 0
ddf19c
+512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
ddf19c
 { 'execute': 'qmp_capabilities' }
ddf19c
 {"return": {}}
ddf19c
 {'execute':'drive-mirror', 'arguments':{ 'device': 'src', 'target': 'TEST_DIR/t.IMGFMT', 'format': 'IMGFMT', 'mode': 'existing', 'sync': 'full'}}
ddf19c
@@ -89,13 +88,12 @@ read 65536/65536 bytes at offset 0
ddf19c
 {"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "BLOCK_JOB_COMPLETED", "data": {"device": "src", "len": 197120, "offset": 197120, "speed": 0, "type": "mirror"}}
ddf19c
 {"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "JOB_STATUS_CHANGE", "data": {"status": "concluded", "id": "src"}}
ddf19c
 {"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "JOB_STATUS_CHANGE", "data": {"status": "null", "id": "src"}}
ddf19c
-Warning: Image size mismatch!
ddf19c
 Images are identical.
ddf19c
 
ddf19c
 === Writing a qed header into raw ===
ddf19c
 
ddf19c
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
ddf19c
 Formatting 'TEST_DIR/t.raw.src', fmt=IMGFMT size=67108864
ddf19c
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=SIZE
ddf19c
 { 'execute': 'qmp_capabilities' }
ddf19c
 {"return": {}}
ddf19c
 {'execute':'drive-mirror', 'arguments':{ 'device': 'src', 'target': 'TEST_DIR/t.IMGFMT', 'mode': 'existing', 'sync': 'full'}}
ddf19c
@@ -115,8 +113,8 @@ WARNING: Image format was not specified for 'TEST_DIR/t.raw' and probing guessed
ddf19c
 {"execute":"quit"}
ddf19c
 {"return": {}}
ddf19c
 {"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "SHUTDOWN", "data": {"guest": false, "reason": "host-qmp-quit"}}
ddf19c
-read 65536/65536 bytes at offset 0
ddf19c
-64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
ddf19c
+read 512/512 bytes at offset 0
ddf19c
+512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
ddf19c
 { 'execute': 'qmp_capabilities' }
ddf19c
 {"return": {}}
ddf19c
 {'execute':'drive-mirror', 'arguments':{ 'device': 'src', 'target': 'TEST_DIR/t.IMGFMT', 'format': 'IMGFMT', 'mode': 'existing', 'sync': 'full'}}
ddf19c
@@ -135,13 +133,12 @@ read 65536/65536 bytes at offset 0
ddf19c
 {"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "BLOCK_JOB_COMPLETED", "data": {"device": "src", "len": 327680, "offset": 327680, "speed": 0, "type": "mirror"}}
ddf19c
 {"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "JOB_STATUS_CHANGE", "data": {"status": "concluded", "id": "src"}}
ddf19c
 {"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "JOB_STATUS_CHANGE", "data": {"status": "null", "id": "src"}}
ddf19c
-Warning: Image size mismatch!
ddf19c
 Images are identical.
ddf19c
 
ddf19c
 === Writing a vdi header into raw ===
ddf19c
 
ddf19c
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
ddf19c
 Formatting 'TEST_DIR/t.raw.src', fmt=IMGFMT size=67108864
ddf19c
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=SIZE
ddf19c
 { 'execute': 'qmp_capabilities' }
ddf19c
 {"return": {}}
ddf19c
 {'execute':'drive-mirror', 'arguments':{ 'device': 'src', 'target': 'TEST_DIR/t.IMGFMT', 'mode': 'existing', 'sync': 'full'}}
ddf19c
@@ -161,8 +158,8 @@ WARNING: Image format was not specified for 'TEST_DIR/t.raw' and probing guessed
ddf19c
 {"execute":"quit"}
ddf19c
 {"return": {}}
ddf19c
 {"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "SHUTDOWN", "data": {"guest": false, "reason": "host-qmp-quit"}}
ddf19c
-read 65536/65536 bytes at offset 0
ddf19c
-64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
ddf19c
+read 512/512 bytes at offset 0
ddf19c
+512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
ddf19c
 { 'execute': 'qmp_capabilities' }
ddf19c
 {"return": {}}
ddf19c
 {'execute':'drive-mirror', 'arguments':{ 'device': 'src', 'target': 'TEST_DIR/t.IMGFMT', 'format': 'IMGFMT', 'mode': 'existing', 'sync': 'full'}}
ddf19c
@@ -181,13 +178,12 @@ read 65536/65536 bytes at offset 0
ddf19c
 {"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "BLOCK_JOB_COMPLETED", "data": {"device": "src", "len": 1024, "offset": 1024, "speed": 0, "type": "mirror"}}
ddf19c
 {"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "JOB_STATUS_CHANGE", "data": {"status": "concluded", "id": "src"}}
ddf19c
 {"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "JOB_STATUS_CHANGE", "data": {"status": "null", "id": "src"}}
ddf19c
-Warning: Image size mismatch!
ddf19c
 Images are identical.
ddf19c
 
ddf19c
 === Writing a vmdk header into raw ===
ddf19c
 
ddf19c
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
ddf19c
 Formatting 'TEST_DIR/t.raw.src', fmt=IMGFMT size=67108864
ddf19c
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=SIZE
ddf19c
 { 'execute': 'qmp_capabilities' }
ddf19c
 {"return": {}}
ddf19c
 {'execute':'drive-mirror', 'arguments':{ 'device': 'src', 'target': 'TEST_DIR/t.IMGFMT', 'mode': 'existing', 'sync': 'full'}}
ddf19c
@@ -207,8 +203,8 @@ WARNING: Image format was not specified for 'TEST_DIR/t.raw' and probing guessed
ddf19c
 {"execute":"quit"}
ddf19c
 {"return": {}}
ddf19c
 {"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "SHUTDOWN", "data": {"guest": false, "reason": "host-qmp-quit"}}
ddf19c
-read 65536/65536 bytes at offset 0
ddf19c
-64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
ddf19c
+read 512/512 bytes at offset 0
ddf19c
+512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
ddf19c
 { 'execute': 'qmp_capabilities' }
ddf19c
 {"return": {}}
ddf19c
 {'execute':'drive-mirror', 'arguments':{ 'device': 'src', 'target': 'TEST_DIR/t.IMGFMT', 'format': 'IMGFMT', 'mode': 'existing', 'sync': 'full'}}
ddf19c
@@ -227,13 +223,12 @@ read 65536/65536 bytes at offset 0
ddf19c
 {"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "BLOCK_JOB_COMPLETED", "data": {"device": "src", "len": 65536, "offset": 65536, "speed": 0, "type": "mirror"}}
ddf19c
 {"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "JOB_STATUS_CHANGE", "data": {"status": "concluded", "id": "src"}}
ddf19c
 {"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "JOB_STATUS_CHANGE", "data": {"status": "null", "id": "src"}}
ddf19c
-Warning: Image size mismatch!
ddf19c
 Images are identical.
ddf19c
 
ddf19c
 === Writing a vpc header into raw ===
ddf19c
 
ddf19c
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
ddf19c
 Formatting 'TEST_DIR/t.raw.src', fmt=IMGFMT size=67108864
ddf19c
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=SIZE
ddf19c
 { 'execute': 'qmp_capabilities' }
ddf19c
 {"return": {}}
ddf19c
 {'execute':'drive-mirror', 'arguments':{ 'device': 'src', 'target': 'TEST_DIR/t.IMGFMT', 'mode': 'existing', 'sync': 'full'}}
ddf19c
@@ -253,8 +248,8 @@ WARNING: Image format was not specified for 'TEST_DIR/t.raw' and probing guessed
ddf19c
 {"execute":"quit"}
ddf19c
 {"return": {}}
ddf19c
 {"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "SHUTDOWN", "data": {"guest": false, "reason": "host-qmp-quit"}}
ddf19c
-read 65536/65536 bytes at offset 0
ddf19c
-64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
ddf19c
+read 512/512 bytes at offset 0
ddf19c
+512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
ddf19c
 { 'execute': 'qmp_capabilities' }
ddf19c
 {"return": {}}
ddf19c
 {'execute':'drive-mirror', 'arguments':{ 'device': 'src', 'target': 'TEST_DIR/t.IMGFMT', 'format': 'IMGFMT', 'mode': 'existing', 'sync': 'full'}}
ddf19c
@@ -273,12 +268,11 @@ read 65536/65536 bytes at offset 0
ddf19c
 {"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "BLOCK_JOB_COMPLETED", "data": {"device": "src", "len": 2560, "offset": 2560, "speed": 0, "type": "mirror"}}
ddf19c
 {"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "JOB_STATUS_CHANGE", "data": {"status": "concluded", "id": "src"}}
ddf19c
 {"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "JOB_STATUS_CHANGE", "data": {"status": "null", "id": "src"}}
ddf19c
-Warning: Image size mismatch!
ddf19c
 Images are identical.
ddf19c
 
ddf19c
 === Copying sample image empty.bochs into raw ===
ddf19c
 
ddf19c
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
ddf19c
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=SIZE
ddf19c
 { 'execute': 'qmp_capabilities' }
ddf19c
 {"return": {}}
ddf19c
 {'execute':'drive-mirror', 'arguments':{ 'device': 'src', 'target': 'TEST_DIR/t.IMGFMT', 'mode': 'existing', 'sync': 'full'}}
ddf19c
@@ -298,8 +292,8 @@ WARNING: Image format was not specified for 'TEST_DIR/t.raw' and probing guessed
ddf19c
 {"execute":"quit"}
ddf19c
 {"return": {}}
ddf19c
 {"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "SHUTDOWN", "data": {"guest": false, "reason": "host-qmp-quit"}}
ddf19c
-read 65536/65536 bytes at offset 0
ddf19c
-64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
ddf19c
+read 512/512 bytes at offset 0
ddf19c
+512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
ddf19c
 { 'execute': 'qmp_capabilities' }
ddf19c
 {"return": {}}
ddf19c
 {'execute':'drive-mirror', 'arguments':{ 'device': 'src', 'target': 'TEST_DIR/t.IMGFMT', 'format': 'IMGFMT', 'mode': 'existing', 'sync': 'full'}}
ddf19c
@@ -318,12 +312,11 @@ read 65536/65536 bytes at offset 0
ddf19c
 {"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "BLOCK_JOB_COMPLETED", "data": {"device": "src", "len": 2560, "offset": 2560, "speed": 0, "type": "mirror"}}
ddf19c
 {"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "JOB_STATUS_CHANGE", "data": {"status": "concluded", "id": "src"}}
ddf19c
 {"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "JOB_STATUS_CHANGE", "data": {"status": "null", "id": "src"}}
ddf19c
-Warning: Image size mismatch!
ddf19c
 Images are identical.
ddf19c
 
ddf19c
 === Copying sample image iotest-dirtylog-10G-4M.vhdx into raw ===
ddf19c
 
ddf19c
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
ddf19c
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=SIZE
ddf19c
 { 'execute': 'qmp_capabilities' }
ddf19c
 {"return": {}}
ddf19c
 {'execute':'drive-mirror', 'arguments':{ 'device': 'src', 'target': 'TEST_DIR/t.IMGFMT', 'mode': 'existing', 'sync': 'full'}}
ddf19c
@@ -343,8 +336,8 @@ WARNING: Image format was not specified for 'TEST_DIR/t.raw' and probing guessed
ddf19c
 {"execute":"quit"}
ddf19c
 {"return": {}}
ddf19c
 {"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "SHUTDOWN", "data": {"guest": false, "reason": "host-qmp-quit"}}
ddf19c
-read 65536/65536 bytes at offset 0
ddf19c
-64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
ddf19c
+read 512/512 bytes at offset 0
ddf19c
+512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
ddf19c
 { 'execute': 'qmp_capabilities' }
ddf19c
 {"return": {}}
ddf19c
 {'execute':'drive-mirror', 'arguments':{ 'device': 'src', 'target': 'TEST_DIR/t.IMGFMT', 'format': 'IMGFMT', 'mode': 'existing', 'sync': 'full'}}
ddf19c
@@ -363,12 +356,11 @@ read 65536/65536 bytes at offset 0
ddf19c
 {"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "BLOCK_JOB_COMPLETED", "data": {"device": "src", "len": 31457280, "offset": 31457280, "speed": 0, "type": "mirror"}}
ddf19c
 {"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "JOB_STATUS_CHANGE", "data": {"status": "concluded", "id": "src"}}
ddf19c
 {"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "JOB_STATUS_CHANGE", "data": {"status": "null", "id": "src"}}
ddf19c
-Warning: Image size mismatch!
ddf19c
 Images are identical.
ddf19c
 
ddf19c
 === Copying sample image parallels-v1 into raw ===
ddf19c
 
ddf19c
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
ddf19c
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=SIZE
ddf19c
 { 'execute': 'qmp_capabilities' }
ddf19c
 {"return": {}}
ddf19c
 {'execute':'drive-mirror', 'arguments':{ 'device': 'src', 'target': 'TEST_DIR/t.IMGFMT', 'mode': 'existing', 'sync': 'full'}}
ddf19c
@@ -388,8 +380,8 @@ WARNING: Image format was not specified for 'TEST_DIR/t.raw' and probing guessed
ddf19c
 {"execute":"quit"}
ddf19c
 {"return": {}}
ddf19c
 {"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "SHUTDOWN", "data": {"guest": false, "reason": "host-qmp-quit"}}
ddf19c
-read 65536/65536 bytes at offset 0
ddf19c
-64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
ddf19c
+read 512/512 bytes at offset 0
ddf19c
+512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
ddf19c
 { 'execute': 'qmp_capabilities' }
ddf19c
 {"return": {}}
ddf19c
 {'execute':'drive-mirror', 'arguments':{ 'device': 'src', 'target': 'TEST_DIR/t.IMGFMT', 'format': 'IMGFMT', 'mode': 'existing', 'sync': 'full'}}
ddf19c
@@ -408,12 +400,11 @@ read 65536/65536 bytes at offset 0
ddf19c
 {"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "BLOCK_JOB_COMPLETED", "data": {"device": "src", "len": 327680, "offset": 327680, "speed": 0, "type": "mirror"}}
ddf19c
 {"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "JOB_STATUS_CHANGE", "data": {"status": "concluded", "id": "src"}}
ddf19c
 {"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "JOB_STATUS_CHANGE", "data": {"status": "null", "id": "src"}}
ddf19c
-Warning: Image size mismatch!
ddf19c
 Images are identical.
ddf19c
 
ddf19c
 === Copying sample image simple-pattern.cloop into raw ===
ddf19c
 
ddf19c
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
ddf19c
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=SIZE
ddf19c
 { 'execute': 'qmp_capabilities' }
ddf19c
 {"return": {}}
ddf19c
 {'execute':'drive-mirror', 'arguments':{ 'device': 'src', 'target': 'TEST_DIR/t.IMGFMT', 'mode': 'existing', 'sync': 'full'}}
ddf19c
@@ -433,8 +424,8 @@ WARNING: Image format was not specified for 'TEST_DIR/t.raw' and probing guessed
ddf19c
 {"execute":"quit"}
ddf19c
 {"return": {}}
ddf19c
 {"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "SHUTDOWN", "data": {"guest": false, "reason": "host-qmp-quit"}}
ddf19c
-read 65536/65536 bytes at offset 0
ddf19c
-64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
ddf19c
+read 512/512 bytes at offset 0
ddf19c
+512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
ddf19c
 { 'execute': 'qmp_capabilities' }
ddf19c
 {"return": {}}
ddf19c
 {'execute':'drive-mirror', 'arguments':{ 'device': 'src', 'target': 'TEST_DIR/t.IMGFMT', 'format': 'IMGFMT', 'mode': 'existing', 'sync': 'full'}}
ddf19c
@@ -453,12 +444,11 @@ read 65536/65536 bytes at offset 0
ddf19c
 {"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "BLOCK_JOB_COMPLETED", "data": {"device": "src", "len": 2048, "offset": 2048, "speed": 0, "type": "mirror"}}
ddf19c
 {"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "JOB_STATUS_CHANGE", "data": {"status": "concluded", "id": "src"}}
ddf19c
 {"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "JOB_STATUS_CHANGE", "data": {"status": "null", "id": "src"}}
ddf19c
-Warning: Image size mismatch!
ddf19c
 Images are identical.
ddf19c
 
ddf19c
 === Write legitimate MBR into raw ===
ddf19c
 
ddf19c
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
ddf19c
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=SIZE
ddf19c
 { 'execute': 'qmp_capabilities' }
ddf19c
 {"return": {}}
ddf19c
 {'execute':'drive-mirror', 'arguments':{ 'device': 'src', 'target': 'TEST_DIR/t.IMGFMT', 'mode': 'existing', 'sync': 'full'}}
ddf19c
@@ -480,7 +470,6 @@ WARNING: Image format was not specified for 'TEST_DIR/t.raw' and probing guessed
ddf19c
 {"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "BLOCK_JOB_COMPLETED", "data": {"device": "src", "len": 512, "offset": 512, "speed": 0, "type": "mirror"}}
ddf19c
 {"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "JOB_STATUS_CHANGE", "data": {"status": "concluded", "id": "src"}}
ddf19c
 {"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "JOB_STATUS_CHANGE", "data": {"status": "null", "id": "src"}}
ddf19c
-Warning: Image size mismatch!
ddf19c
 Images are identical.
ddf19c
 { 'execute': 'qmp_capabilities' }
ddf19c
 {"return": {}}
ddf19c
@@ -500,6 +489,5 @@ Images are identical.
ddf19c
 {"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "BLOCK_JOB_COMPLETED", "data": {"device": "src", "len": 512, "offset": 512, "speed": 0, "type": "mirror"}}
ddf19c
 {"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "JOB_STATUS_CHANGE", "data": {"status": "concluded", "id": "src"}}
ddf19c
 {"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "JOB_STATUS_CHANGE", "data": {"status": "null", "id": "src"}}
ddf19c
-Warning: Image size mismatch!
ddf19c
 Images are identical.
ddf19c
 *** done
ddf19c
diff --git a/tests/qemu-iotests/common.filter b/tests/qemu-iotests/common.filter
ddf19c
index 5367dee..c8e8663 100644
ddf19c
--- a/tests/qemu-iotests/common.filter
ddf19c
+++ b/tests/qemu-iotests/common.filter
ddf19c
@@ -149,6 +149,11 @@ _filter_img_create()
ddf19c
         -e "s# force_size=\\(on\\|off\\)##g"
ddf19c
 }
ddf19c
 
ddf19c
+_filter_img_create_size()
ddf19c
+{
ddf19c
+    $SED -e "s# size=[0-9]\\+# size=SIZE#g"
ddf19c
+}
ddf19c
+
ddf19c
 _filter_img_info()
ddf19c
 {
ddf19c
     if [[ "$1" == "--format-specific" ]]; then
ddf19c
-- 
ddf19c
1.8.3.1
ddf19c