[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PATCH v7 8/8] iotests: Use event_wait in wait_ready
From: |
Fam Zheng |
Subject: |
[Qemu-block] [PATCH v7 8/8] iotests: Use event_wait in wait_ready |
Date: |
Mon, 8 Jun 2015 13:56:14 +0800 |
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>
Reviewed-by: John Snow <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 63de726..8615b10 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)
--
2.4.2
- [Qemu-block] [PATCH v7 0/8] block: Mirror discarded sectors, Fam Zheng, 2015/06/08
- [Qemu-block] [PATCH v7 1/8] block: Add bdrv_get_block_status_above, Fam Zheng, 2015/06/08
- [Qemu-block] [PATCH v7 2/8] qmp: Add optional bool "unmap" to drive-mirror, Fam Zheng, 2015/06/08
- [Qemu-block] [PATCH v7 3/8] mirror: Do zero write on target if sectors not allocated, Fam Zheng, 2015/06/08
- [Qemu-block] [PATCH v7 4/8] block: Fix dirty bitmap in bdrv_co_discard, Fam Zheng, 2015/06/08
- [Qemu-block] [PATCH v7 5/8] block: Remove bdrv_reset_dirty, Fam Zheng, 2015/06/08
- [Qemu-block] [PATCH v7 6/8] qemu-iotests: Make block job methods common, Fam Zheng, 2015/06/08
- [Qemu-block] [PATCH v7 7/8] qemu-iotests: Add test case for mirror with unmap, Fam Zheng, 2015/06/08
- [Qemu-block] [PATCH v7 8/8] iotests: Use event_wait in wait_ready,
Fam Zheng <=
- Re: [Qemu-block] [PATCH v7 0/8] block: Mirror discarded sectors, Stefan Hajnoczi, 2015/06/08
- Re: [Qemu-block] [PATCH v7 0/8] block: Mirror discarded sectors, Fam Zheng, 2015/06/11
- Re: [Qemu-block] [Qemu-stable] [PATCH v7 0/8] block: Mirror discarded sectors, Fam Zheng, 2015/06/24
- Re: [Qemu-block] [Qemu-stable] [PATCH v7 0/8] block: Mirror discarded sectors, Paolo Bonzini, 2015/06/24
- Re: [Qemu-block] [Qemu-stable] [PATCH v7 0/8] block: Mirror discarded sectors, Fam Zheng, 2015/06/24
- Re: [Qemu-block] [Qemu-devel] [Qemu-stable] [PATCH v7 0/8] block: Mirror discarded sectors, Fam Zheng, 2015/06/25
- Re: [Qemu-block] [Qemu-devel] [Qemu-stable] [PATCH v7 0/8] block: Mirror discarded sectors, Alexandre DERUMIER, 2015/06/26
- Re: [Qemu-block] [Qemu-devel] [Qemu-stable] [PATCH v7 0/8] block: Mirror discarded sectors, Alexandre DERUMIER, 2015/06/26
- Re: [Qemu-block] [Qemu-devel] [Qemu-stable] [PATCH v7 0/8] block: Mirror discarded sectors, Fam Zheng, 2015/06/28
Re: [Qemu-block] [PATCH v7 0/8] block: Mirror discarded sectors, Stefan Hajnoczi, 2015/06/26