]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
iotests: test active mirror with unaligned, small write zeroes op
authorFiona Ebner <f.ebner@proxmox.com>
Tue, 20 Jan 2026 11:38:57 +0000 (12:38 +0100)
committerVladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Thu, 12 Feb 2026 08:38:18 +0000 (11:38 +0300)
This tests the scenario fixed by "block/mirror: check range
when setting zero bitmap for sync write" [0].

[0] https://lore.kernel.org/qemu-devel/20260112152544.261923-1-f.ebner@proxmox.com/

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Message-ID: <20260120113859.251743-1-f.ebner@proxmox.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Tested-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
tests/qemu-iotests/151
tests/qemu-iotests/151.out

index 06ee3585db9045e9890635049b941a651cdea0a3..9b9c815db58eaeff4e0ff24d2356592804046bfc 100755 (executable)
@@ -191,6 +191,26 @@ class TestActiveMirror(iotests.QMPTestCase):
 
         self.potential_writes_in_flight = False
 
+    def testUnalignedSmallerThanGranularityWriteZeroes(self):
+        # Fill the source image
+        self.vm.hmp_qemu_io('source', 'write -P 1 0 %i' % self.image_len);
+
+        # Start the block job
+        self.vm.cmd('blockdev-mirror',
+                    job_id='mirror',
+                    filter_node_name='mirror-node',
+                    device='source-node',
+                    target='target-node',
+                    sync='full',
+                    copy_mode='write-blocking')
+
+        # Wait for the READY event
+        self.wait_ready(drive='mirror')
+
+        for offset in range(6 * self.image_len // 8, 7 * self.image_len // 8, 1024 * 1024):
+            self.vm.hmp_qemu_io('source', 'aio_write -z %i 512' % (offset + 512))
+
+        self.complete_and_wait(drive='mirror', wait_ready=False)
 
 class TestThrottledWithNbdExportBase(iotests.QMPTestCase):
     image_len = 128 * 1024 * 1024  # MB
index 3f8a935a082d8dde81eafb46b644fdff9d1a0cce..2f7d3902f23e5a79d53cc6c99acce8df02f5cd31 100644 (file)
@@ -1,5 +1,5 @@
-......
+.......
 ----------------------------------------------------------------------
-Ran 6 tests
+Ran 7 tests
 
 OK