aboutsummaryrefslogtreecommitdiff
path: root/tests/qemu-iotests/041
diff options
context:
space:
mode:
Diffstat (limited to 'tests/qemu-iotests/041')
-rwxr-xr-xtests/qemu-iotests/04114
1 files changed, 2 insertions, 12 deletions
diff --git a/tests/qemu-iotests/041 b/tests/qemu-iotests/041
index 1e923e70ca..6661c0395d 100755
--- a/tests/qemu-iotests/041
+++ b/tests/qemu-iotests/041
@@ -57,18 +57,8 @@ class ImageMirroringTestCase(iotests.QMPTestCase):
result = self.vm.qmp('block-job-complete', device=drive)
self.assert_qmp(result, 'return', {})
- completed = False
- while not completed:
- for event in self.vm.get_qmp_events(wait=True):
- if event['event'] == 'BLOCK_JOB_COMPLETED':
- self.assert_qmp(event, 'data/type', 'mirror')
- self.assert_qmp(event, 'data/device', drive)
- self.assert_qmp_absent(event, 'data/error')
- self.assert_qmp(event, 'data/offset', self.image_len)
- self.assert_qmp(event, 'data/len', self.image_len)
- completed = True
-
- self.assert_no_active_block_jobs()
+ event = self.wait_until_completed()
+ self.assert_qmp(event, 'data/type', 'mirror')
class TestSingleDrive(ImageMirroringTestCase):
image_len = 1 * 1024 * 1024 # MB