qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] iotests: Test unaligned blocking mirror write


From: Vladimir Sementsov-Ogievskiy
Subject: Re: [Qemu-devel] [PATCH] iotests: Test unaligned blocking mirror write
Date: Mon, 5 Aug 2019 12:44:37 +0000

05.08.2019 14:35, Max Reitz wrote:
> Signed-off-by: Max Reitz <address@hidden>
> ---
> Hi, this is a test for the mirror bug Vladimir found.  Naturally, it
> depends on some patch to fix it.
> 
> Based-on: <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')

2M of ones

> +
> +        # 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))

write only one byte, but unset the whole granularity chunk in bitmap, so it 
would be
skipped from sequential mirroring loop, and final image comparison will fail

> +
> +        # 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
> 

Reviewed-by: Vladimir Sementsov-Ogievskiy <address@hidden>

Not putting now tested-by as we didn't decide what is the base. However, I've
checked that new test-case fails on master.

-- 
Best regards,
Vladimir

reply via email to

[Prev in Thread] Current Thread [Next in Thread]