qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v2 6/6] iotests: Use event_wait in wait_ready


From: John Snow
Subject: Re: [Qemu-devel] [PATCH v2 6/6] iotests: Use event_wait in wait_ready
Date: Mon, 11 May 2015 16:34:03 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0


On 05/06/2015 12:52 AM, Fam Zheng wrote:
> Only poll the specific type of event we are interested in, to avoid
> stealing events that should be consumed by someone else.
> 
> Suggested-by: John Snow <address@hidden>
> Signed-off-by: Fam Zheng <address@hidden>
> ---
>  tests/qemu-iotests/iotests.py | 9 ++-------
>  1 file changed, 2 insertions(+), 7 deletions(-)
> 
> diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
> index 2e07cc4..0ddc513 100644
> --- a/tests/qemu-iotests/iotests.py
> +++ b/tests/qemu-iotests/iotests.py
> @@ -328,13 +328,8 @@ class QMPTestCase(unittest.TestCase):
>  
>      def wait_ready(self, drive='drive0'):
>          '''Wait until a block job BLOCK_JOB_READY event'''
> -        ready = False
> -        while not ready:
> -            for event in self.vm.get_qmp_events(wait=True):
> -                if event['event'] == 'BLOCK_JOB_READY':
> -                    self.assert_qmp(event, 'data/type', 'mirror')
> -                    self.assert_qmp(event, 'data/device', drive)
> -                    ready = True
> +        f = {'data': {'type': 'mirror', 'device': drive } }
> +        event = self.vm.event_wait(name='BLOCK_JOB_READY', match=f)
>  
>      def wait_ready_and_cancel(self, drive='drive0'):
>          self.wait_ready(drive=drive)
> 

Thanks for appeasing me :)

Reviewed-by: John Snow <address@hidden>



reply via email to

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