thebeanogamer / rpms / qemu-kvm

Forked from rpms/qemu-kvm 5 months ago
Clone

Blame SOURCES/kvm-qemu-iotests-Preallocated-zero-clusters-in-061.patch

9ae3a8
From 6c3f41d4c4e48cb641c8cf17f6df7b60558427ac Mon Sep 17 00:00:00 2001
9ae3a8
From: Max Reitz <mreitz@redhat.com>
9ae3a8
Date: Tue, 7 Jan 2014 21:57:19 +0100
9ae3a8
Subject: [PATCH 14/14] qemu-iotests: Preallocated zero clusters in 061
9ae3a8
9ae3a8
RH-Author: Max Reitz <mreitz@redhat.com>
9ae3a8
Message-id: <1389131839-12920-15-git-send-email-mreitz@redhat.com>
9ae3a8
Patchwork-id: 56550
9ae3a8
O-Subject: [RHEL-7.0 qemu-kvm PATCH v2 14/14] qemu-iotests: Preallocated zero clusters in 061
9ae3a8
Bugzilla: 1033490
9ae3a8
RH-Acked-by: Kevin Wolf <kwolf@redhat.com>
9ae3a8
RH-Acked-by: Fam Zheng <famz@redhat.com>
9ae3a8
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
9ae3a8
9ae3a8
BZ: 1033490
9ae3a8
9ae3a8
Add a test case for zero cluster expansion on an image completely filled
9ae3a8
with preallocated zero clusters to test 061.
9ae3a8
9ae3a8
Signed-off-by: Max Reitz <mreitz@redhat.com>
9ae3a8
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
9ae3a8
(cherry picked from commit fd9e03e6060b3a64099d17e4a886421b21dd7341)
9ae3a8
9ae3a8
Signed-off-by: Max Reitz <mreitz@redhat.com>
9ae3a8
---
9ae3a8
 tests/qemu-iotests/061     |  9 +++++++++
9ae3a8
 tests/qemu-iotests/061.out | 11 +++++++++++
9ae3a8
 2 files changed, 20 insertions(+)
9ae3a8
9ae3a8
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
9ae3a8
---
9ae3a8
 tests/qemu-iotests/061     |    9 +++++++++
9ae3a8
 tests/qemu-iotests/061.out |   11 +++++++++++
9ae3a8
 2 files changed, 20 insertions(+), 0 deletions(-)
9ae3a8
9ae3a8
diff --git a/tests/qemu-iotests/061 b/tests/qemu-iotests/061
9ae3a8
index 5f04bfa..fa9319d 100644
9ae3a8
--- a/tests/qemu-iotests/061
9ae3a8
+++ b/tests/qemu-iotests/061
9ae3a8
@@ -200,6 +200,15 @@ $QEMU_IMG snapshot -a foo "$TEST_IMG"
9ae3a8
 _check_test_img
9ae3a8
 $QEMU_IO -c "read -P 0 0 128k" "$TEST_IMG" | _filter_qemu_io
9ae3a8
 
9ae3a8
+echo
9ae3a8
+echo "=== Testing preallocated zero expansion on full image ==="
9ae3a8
+echo
9ae3a8
+IMGOPTS="compat=1.1" TEST_IMG="$TEST_IMG" _make_test_img 64M
9ae3a8
+$QEMU_IO -c "write -P 0x2a 0 64M" "$TEST_IMG" -c "write -z 0 64M" | _filter_qemu_io
9ae3a8
+$QEMU_IMG amend -o "compat=0.10" "$TEST_IMG"
9ae3a8
+_check_test_img
9ae3a8
+$QEMU_IO -c "read -P 0 0 64M" "$TEST_IMG" | _filter_qemu_io
9ae3a8
+
9ae3a8
 # success, all done
9ae3a8
 echo "*** done"
9ae3a8
 rm -f $seq.full
9ae3a8
diff --git a/tests/qemu-iotests/061.out b/tests/qemu-iotests/061.out
9ae3a8
index d42127f..4027e00 100644
9ae3a8
--- a/tests/qemu-iotests/061.out
9ae3a8
+++ b/tests/qemu-iotests/061.out
9ae3a8
@@ -373,4 +373,15 @@ read 131072/131072 bytes at offset 0
9ae3a8
 No errors were found on the image.
9ae3a8
 read 131072/131072 bytes at offset 0
9ae3a8
 128 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
9ae3a8
+
9ae3a8
+=== Testing preallocated zero expansion on full image ===
9ae3a8
+
9ae3a8
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 
9ae3a8
+wrote 67108864/67108864 bytes at offset 0
9ae3a8
+64 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
9ae3a8
+wrote 67108864/67108864 bytes at offset 0
9ae3a8
+64 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
9ae3a8
+No errors were found on the image.
9ae3a8
+read 67108864/67108864 bytes at offset 0
9ae3a8
+64 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
9ae3a8
 *** done
9ae3a8
-- 
9ae3a8
1.7.1
9ae3a8