]> git.proxmox.com Git - mirror_qemu.git/commitdiff
iotests: Test unaligned blocking mirror write
authorMax Reitz <mreitz@redhat.com>
Mon, 5 Aug 2019 11:35:26 +0000 (13:35 +0200)
committerMax Reitz <mreitz@redhat.com>
Tue, 6 Aug 2019 11:17:26 +0000 (13:17 +0200)
Signed-off-by: Max Reitz <mreitz@redhat.com>
Message-id: 20190805113526.20319-1-mreitz@redhat.com
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
tests/qemu-iotests/151
tests/qemu-iotests/151.out

index 1bb74d67c429c163687812529ceb288770c7e68a..ad7359fc8d0201e83dc5eeb92ed2325fc7b250de 100755 (executable)
@@ -114,6 +114,31 @@ class TestActiveMirror(iotests.QMPTestCase):
     def testActiveIOFlushed(self):
         self.doActiveIO(True)
 
+    def testUnalignedActiveIO(self):
+        # Fill the source image
+        result = self.vm.hmp_qemu_io('source', 'write -P 1 0 2M')
+
+        # Start the block job (very slowly)
+        result = self.vm.qmp('blockdev-mirror',
+                             job_id='mirror',
+                             filter_node_name='mirror-node',
+                             device='source-node',
+                             target='target-node',
+                             sync='full',
+                             copy_mode='write-blocking',
+                             buf_size=(1048576 // 4),
+                             speed=1)
+        self.assert_qmp(result, 'return', {})
+
+        # Start an unaligned request to a dirty area
+        result = self.vm.hmp_qemu_io('source', 'write -P 2 %i 1' % (1048576 + 42))
+
+        # Let the job finish
+        result = self.vm.qmp('block-job-set-speed', device='mirror', speed=0)
+        self.assert_qmp(result, 'return', {})
+        self.complete_and_wait(drive='mirror')
+
+        self.potential_writes_in_flight = False
 
 
 if __name__ == '__main__':
index fbc63e62f885f55a8d6c777b49b180d529ba6e8e..8d7e996700935285e77f1c1156959cc27a7931bf 100644 (file)
@@ -1,5 +1,5 @@
-..
+...
 ----------------------------------------------------------------------
-Ran 2 tests
+Ran 3 tests
 
 OK