|
|
495e37 |
From 51f691acd8042351d005873996d7bf4c7b045508 Mon Sep 17 00:00:00 2001
|
|
|
495e37 |
From: Kevin Wolf <kwolf@redhat.com>
|
|
|
495e37 |
Date: Fri, 17 Dec 2021 17:46:53 +0100
|
|
|
495e37 |
Subject: [PATCH 08/12] iotests: Test qemu-img convert of zeroed data cluster
|
|
|
495e37 |
|
|
|
495e37 |
RH-Author: Kevin Wolf <kwolf@redhat.com>
|
|
|
495e37 |
RH-MergeRequest: 70: qemu-img convert: Fix sparseness of output image
|
|
|
495e37 |
RH-Commit: [1/2] 0770582c553ac6b0f18c035f9a0238599d4763cc (kmwolf/centos-qemu-kvm)
|
|
|
495e37 |
RH-Bugzilla: 1882917
|
|
|
495e37 |
RH-Acked-by: Eric Blake <eblake@redhat.com>
|
|
|
495e37 |
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
|
|
|
495e37 |
RH-Acked-by: Hanna Reitz <hreitz@redhat.com>
|
|
|
495e37 |
|
|
|
495e37 |
This demonstrates what happens when the block status changes in
|
|
|
495e37 |
sub-min_sparse granularity, but all of the parts are zeroed out. The
|
|
|
495e37 |
alignment logic in is_allocated_sectors() prevents that the target image
|
|
|
495e37 |
remains fully sparse as expected, but turns it into a data cluster of
|
|
|
495e37 |
explicit zeros.
|
|
|
495e37 |
|
|
|
495e37 |
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
|
|
|
495e37 |
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
|
|
|
495e37 |
Message-Id: <20211217164654.1184218-2-vsementsov@virtuozzo.com>
|
|
|
495e37 |
Tested-by: Peter Lieven <pl@kamp.de>
|
|
|
495e37 |
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
|
|
|
495e37 |
(cherry picked from commit 51cd8bddd63540514d44808f7920811439baa253)
|
|
|
495e37 |
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
|
|
|
495e37 |
---
|
|
|
495e37 |
tests/qemu-iotests/122 | 1 +
|
|
|
495e37 |
tests/qemu-iotests/122.out | 10 ++++++++--
|
|
|
495e37 |
2 files changed, 9 insertions(+), 2 deletions(-)
|
|
|
495e37 |
|
|
|
495e37 |
diff --git a/tests/qemu-iotests/122 b/tests/qemu-iotests/122
|
|
|
495e37 |
index efb260d822..be0f6b79e5 100755
|
|
|
495e37 |
--- a/tests/qemu-iotests/122
|
|
|
495e37 |
+++ b/tests/qemu-iotests/122
|
|
|
495e37 |
@@ -251,6 +251,7 @@ $QEMU_IO -c "write -P 0 0 64k" "$TEST_IMG" 2>&1 | _filter_qemu_io | _filter_test
|
|
|
495e37 |
$QEMU_IO -c "write 0 1k" "$TEST_IMG" 2>&1 | _filter_qemu_io | _filter_testdir
|
|
|
495e37 |
$QEMU_IO -c "write 8k 1k" "$TEST_IMG" 2>&1 | _filter_qemu_io | _filter_testdir
|
|
|
495e37 |
$QEMU_IO -c "write 17k 1k" "$TEST_IMG" 2>&1 | _filter_qemu_io | _filter_testdir
|
|
|
495e37 |
+$QEMU_IO -c "write -P 0 65k 1k" "$TEST_IMG" 2>&1 | _filter_qemu_io | _filter_testdir
|
|
|
495e37 |
|
|
|
495e37 |
for min_sparse in 4k 8k; do
|
|
|
495e37 |
echo
|
|
|
495e37 |
diff --git a/tests/qemu-iotests/122.out b/tests/qemu-iotests/122.out
|
|
|
495e37 |
index 8fbdac2b39..69b8e8b803 100644
|
|
|
495e37 |
--- a/tests/qemu-iotests/122.out
|
|
|
495e37 |
+++ b/tests/qemu-iotests/122.out
|
|
|
495e37 |
@@ -192,6 +192,8 @@ wrote 1024/1024 bytes at offset 8192
|
|
|
495e37 |
1 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
|
|
|
495e37 |
wrote 1024/1024 bytes at offset 17408
|
|
|
495e37 |
1 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
|
|
|
495e37 |
+wrote 1024/1024 bytes at offset 66560
|
|
|
495e37 |
+1 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
|
|
|
495e37 |
|
|
|
495e37 |
convert -S 4k
|
|
|
495e37 |
[{ "start": 0, "length": 4096, "depth": 0, "present": true, "zero": false, "data": true, "offset": OFFSET},
|
|
|
495e37 |
@@ -199,7 +201,9 @@ convert -S 4k
|
|
|
495e37 |
{ "start": 8192, "length": 4096, "depth": 0, "present": true, "zero": false, "data": true, "offset": OFFSET},
|
|
|
495e37 |
{ "start": 12288, "length": 4096, "depth": 0, "present": false, "zero": true, "data": false},
|
|
|
495e37 |
{ "start": 16384, "length": 4096, "depth": 0, "present": true, "zero": false, "data": true, "offset": OFFSET},
|
|
|
495e37 |
-{ "start": 20480, "length": 67088384, "depth": 0, "present": false, "zero": true, "data": false}]
|
|
|
495e37 |
+{ "start": 20480, "length": 46080, "depth": 0, "present": false, "zero": true, "data": false},
|
|
|
495e37 |
+{ "start": 66560, "length": 1024, "depth": 0, "present": true, "zero": false, "data": true, "offset": OFFSET},
|
|
|
495e37 |
+{ "start": 67584, "length": 67041280, "depth": 0, "present": false, "zero": true, "data": false}]
|
|
|
495e37 |
|
|
|
495e37 |
convert -c -S 4k
|
|
|
495e37 |
[{ "start": 0, "length": 1024, "depth": 0, "present": true, "zero": false, "data": true},
|
|
|
495e37 |
@@ -211,7 +215,9 @@ convert -c -S 4k
|
|
|
495e37 |
|
|
|
495e37 |
convert -S 8k
|
|
|
495e37 |
[{ "start": 0, "length": 24576, "depth": 0, "present": true, "zero": false, "data": true, "offset": OFFSET},
|
|
|
495e37 |
-{ "start": 24576, "length": 67084288, "depth": 0, "present": false, "zero": true, "data": false}]
|
|
|
495e37 |
+{ "start": 24576, "length": 41984, "depth": 0, "present": false, "zero": true, "data": false},
|
|
|
495e37 |
+{ "start": 66560, "length": 1024, "depth": 0, "present": true, "zero": false, "data": true, "offset": OFFSET},
|
|
|
495e37 |
+{ "start": 67584, "length": 67041280, "depth": 0, "present": false, "zero": true, "data": false}]
|
|
|
495e37 |
|
|
|
495e37 |
convert -c -S 8k
|
|
|
495e37 |
[{ "start": 0, "length": 1024, "depth": 0, "present": true, "zero": false, "data": true},
|
|
|
495e37 |
--
|
|
|
495e37 |
2.27.0
|
|
|
495e37 |
|