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

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