import os
from qemu.machine import machine
-from qemu.qmp import QMPConnectError
import iotests
from iotests import change_log_level, qemu_img
self.vm_b.add_blockdev(f'file,node-name=drive0,filename={source}')
self.vm_b.add_device('virtio-blk,drive=drive0,share-rw=on')
try:
- # Silence AQMP errors temporarily.
- # TODO: Remove this and just allow the errors to be logged when
- # AQMP fully replaces QMP.
+ # Silence AQMP logging errors temporarily.
with change_log_level('qemu.aqmp'):
self.vm_b.launch()
print('ERROR: VM B launched successfully, '
'this should not have happened')
- except (QMPConnectError, machine.VMLaunchFailure):
- assert 'Is another process using the image' in self.vm_b.get_log()
+ except machine.VMLaunchFailure as exc:
+ assert 'Is another process using the image' in exc.output
result = self.vm.qmp('block-job-cancel',
device='mirror')