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

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