[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 6/7] iotests: Test unaligned blocking mirror write
From: |
Max Reitz |
Subject: |
[Qemu-devel] [PULL 6/7] iotests: Test unaligned blocking mirror write |
Date: |
Mon, 5 Aug 2019 18:37:39 +0200 |
Signed-off-by: Max Reitz <address@hidden>
Message-id: address@hidden
Reviewed-by: Vladimir Sementsov-Ogievskiy <address@hidden>
Signed-off-by: Max Reitz <address@hidden>
---
tests/qemu-iotests/151 | 25 +++++++++++++++++++++++++
tests/qemu-iotests/151.out | 4 ++--
2 files changed, 27 insertions(+), 2 deletions(-)
diff --git a/tests/qemu-iotests/151 b/tests/qemu-iotests/151
index 1bb74d67c4..ad7359fc8d 100755
--- a/tests/qemu-iotests/151
+++ b/tests/qemu-iotests/151
@@ -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__':
diff --git a/tests/qemu-iotests/151.out b/tests/qemu-iotests/151.out
index fbc63e62f8..8d7e996700 100644
--- a/tests/qemu-iotests/151.out
+++ b/tests/qemu-iotests/151.out
@@ -1,5 +1,5 @@
-..
+...
----------------------------------------------------------------------
-Ran 2 tests
+Ran 3 tests
OK
--
2.21.0
- [Qemu-devel] [PULL 0/7] Block patches for 4.1.0-rc4, Max Reitz, 2019/08/05
- [Qemu-devel] [PULL 1/7] backup: Copy only dirty areas, Max Reitz, 2019/08/05
- [Qemu-devel] [PULL 2/7] iotests: Test backup job with two guest writes, Max Reitz, 2019/08/05
- [Qemu-devel] [PULL 3/7] util/hbitmap: update orig_size on truncate, Max Reitz, 2019/08/05
- [Qemu-devel] [PULL 4/7] iotests: Test incremental backup after truncation, Max Reitz, 2019/08/05
- [Qemu-devel] [PULL 5/7] mirror: Only mirror granularity-aligned chunks, Max Reitz, 2019/08/05
- [Qemu-devel] [PULL 6/7] iotests: Test unaligned blocking mirror write,
Max Reitz <=
- [Qemu-devel] [PULL 7/7] block/backup: disable copy_range for compressed backup, Max Reitz, 2019/08/05
- Re: [Qemu-devel] [PULL 0/7] Block patches for 4.1.0-rc4, Vladimir Sementsov-Ogievskiy, 2019/08/05
Re: [Qemu-devel] [PULL 0/7] Block patches for 4.1.0-rc4, Peter Maydell, 2019/08/05