@@ -67,20 +67,18 @@ dest_vm.qmp('migrate-set-capabilities',
capabilities=[{'capability': 'events', 'state': True}])
iotests.log(source_vm.qmp('migrate', uri='unix:{0}'.format(migration_sock_path)))
-iotests.log('Gracefully ending the `drive-mirror` job on source...')
-iotests.log(source_vm.qmp('block-job-cancel', device='mirror-job0'))
-
-iotests.log('Stopping the NBD server on destination...')
-iotests.log(dest_vm.qmp('nbd-server-stop'))
-
while True:
event1 = source_vm.event_wait('MIGRATION')
iotests.log(event1, filters=[iotests.filter_qmp_event])
if event1['data']['status'] in ('completed', 'failed'):
+ iotests.log('Gracefully ending the `drive-mirror` job on source...')
+ iotests.log(source_vm.qmp('block-job-cancel', device='mirror-job0'))
break
while True:
event2 = source_vm.event_wait('BLOCK_JOB_COMPLETED')
iotests.log(event2, filters=[iotests.filter_qmp_event])
if event2['event'] == 'BLOCK_JOB_COMPLETED':
+ iotests.log('Stopping the NBD server on destination...')
+ iotests.log(dest_vm.qmp('nbd-server-stop'))
break