@@ -25,7 +25,7 @@ from iotests import qemu_img_create, qemu_io, file_path, log
sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', 'scripts'))
-from qemu import QEMUMachine
+from qemu import QEMUMachine, kvm_available
# Note:
# This test was added to check that mirror dead-lock was fixed (see previous
@@ -49,7 +49,8 @@ qemu_img_create('-f', iotests.imgfmt, '-o', 'preallocation=metadata', disk,
str(size))
vm = QEMUMachine(iotests.qemu_prog)
-vm.add_args('-machine', 'accel=kvm')
+if kvm_available():
+ vm.add_args('-machine', 'accel=kvm')
if iotests.qemu_default_machine == 's390-ccw-virtio':
vm.add_args('-no-shutdown')
vm.add_args('-drive', 'id=src,file=' + disk)
@@ -25,7 +25,7 @@ from iotests import log
sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', 'scripts'))
-from qemu import QEMUMachine
+from qemu import QEMUMachine, kvm_available
if iotests.qemu_default_machine == 's390-ccw-virtio':
virtio_scsi_device = 'virtio-scsi-ccw'
@@ -33,7 +33,8 @@ else:
virtio_scsi_device = 'virtio-scsi-pci'
vm = QEMUMachine(iotests.qemu_prog)
-vm.add_args('-machine', 'accel=kvm')
+if kvm_available():
+ vm.add_args('-machine', 'accel=kvm')
vm.launch()
log(vm.qmp('blockdev-add', node_name='hd0', driver='null-co'))
There are certainly some improvements to be made with regards to kvm capabilities detection, but this seems good enough for this specific case. Signed-off-by: Cleber Rosa <crosa@redhat.com> --- tests/qemu-iotests/235 | 5 +++-- tests/qemu-iotests/238 | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-)