[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-stable] [PATCH 35/53] iotests: Use event_wait in wait_ready
From: |
Michael Roth |
Subject: |
[Qemu-stable] [PATCH 35/53] iotests: Use event_wait in wait_ready |
Date: |
Thu, 30 Jul 2015 06:32:50 -0500 |
From: Fam Zheng <address@hidden>
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>
Signed-off-by: Stefan Hajnoczi <address@hidden>
(cherry picked from commit d7b25297920d18fa2a2cde1ed21fde38a88c935f)
Signed-off-by: Michael Roth <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 b1d0c51..05909da 100644
--- a/tests/qemu-iotests/iotests.py
+++ b/tests/qemu-iotests/iotests.py
@@ -290,13 +290,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)
--
1.9.1
- [Qemu-stable] [PATCH 26/53] hw/core: rebase sysbus_get_fw_dev_path() to g_strdup_printf(), (continued)
- [Qemu-stable] [PATCH 26/53] hw/core: rebase sysbus_get_fw_dev_path() to g_strdup_printf(), Michael Roth, 2015/07/30
- [Qemu-stable] [PATCH 28/53] virtio-ccw: complete handling of guest-initiated resets, Michael Roth, 2015/07/30
- [Qemu-stable] [PATCH 27/53] vhost: correctly pass error to caller in vhost_dev_enable_notifiers(), Michael Roth, 2015/07/30
- [Qemu-stable] [PATCH 29/53] block: Add bdrv_get_block_status_above, Michael Roth, 2015/07/30
- [Qemu-stable] [PATCH 32/53] block: Fix dirty bitmap in bdrv_co_discard, Michael Roth, 2015/07/30
- [Qemu-stable] [PATCH 33/53] qemu-iotests: Make block job methods common, Michael Roth, 2015/07/30
- [Qemu-stable] [PATCH 31/53] mirror: Do zero write on target if sectors not allocated, Michael Roth, 2015/07/30
- [Qemu-stable] [PATCH 30/53] qmp: Add optional bool "unmap" to drive-mirror, Michael Roth, 2015/07/30
- [Qemu-stable] [PATCH 34/53] qemu-iotests: Add test case for mirror with unmap, Michael Roth, 2015/07/30
- [Qemu-stable] [PATCH 36/53] iotests: add QMP event waiting queue, Michael Roth, 2015/07/30
- [Qemu-stable] [PATCH 35/53] iotests: Use event_wait in wait_ready,
Michael Roth <=
- [Qemu-stable] [PATCH 37/53] block/nfs: limit maximum readahead size to 1MB, Michael Roth, 2015/07/30
- [Qemu-stable] [PATCH 38/53] s390x/ipl: Fix boot if no bootindex was specified, Michael Roth, 2015/07/30
- [Qemu-stable] [PATCH 39/53] spapr_vty: lookup should only return valid VTY objects, Michael Roth, 2015/07/30
- [Qemu-stable] [PATCH 03/53] Strip brackets from vnc host, Michael Roth, 2015/07/30
- [Qemu-stable] [PATCH 42/53] block: Initialize local_err in bdrv_append_temp_snapshot, Michael Roth, 2015/07/30
- [Qemu-stable] [PATCH 43/53] mips/kvm: Fix Big endian 32-bit register access, Michael Roth, 2015/07/30
- [Qemu-stable] [PATCH 02/53] block/iscsi: do not forget to logout from target, Michael Roth, 2015/07/30
- [Qemu-stable] [PATCH 45/53] vfio/pci: Fix RTL8168 NIC quirks, Michael Roth, 2015/07/30
- [Qemu-stable] [PATCH 46/53] virtio-net: unbreak any layout, Michael Roth, 2015/07/30
- [Qemu-stable] [PATCH 40/53] target-ppc: fix hugepage support when using memory-backend-file, Michael Roth, 2015/07/30