Skip to content

Commit 359a856

Browse files
vivierstsquad
authored andcommitted
iotests: iothreads need ioeventfd
And ioeventfd are only available with virtio-scsi-pci or virtio-scsi-ccw, use the alias but add a rule to require virtio-scsi-pci or virtio-scsi-ccw for the tests that use iothreads. Signed-off-by: Laurent Vivier <laurent@vivier.eu> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-Id: <20210319202335.2397060-7-laurent@vivier.eu> Message-Id: <20210323165308.15244-22-alex.bennee@linaro.org>
1 parent 7033f1f commit 359a856

File tree

4 files changed

+24
-3
lines changed

4 files changed

+24
-3
lines changed

tests/qemu-iotests/127

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
4444
_supported_fmt qcow2
4545
_supported_proto file fuse
4646

47-
_require_devices virtio-scsi scsi-hd
47+
_require_devices scsi-hd
48+
_require_one_device_of virtio-scsi-pci virtio-scsi-ccw
4849

4950
IMG_SIZE=64K
5051

tests/qemu-iotests/256

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ import os
2424
import iotests
2525
from iotests import log
2626

27+
iotests._verify_virtio_scsi_pci_or_ccw()
28+
2729
iotests.script_initialize(supported_fmts=['qcow2'])
2830
size = 64 * 1024 * 1024
2931

@@ -61,8 +63,8 @@ with iotests.FilePath('img0') as img0_path, \
6163
log('--- Preparing images & VM ---\n')
6264
vm.add_object('iothread,id=iothread0')
6365
vm.add_object('iothread,id=iothread1')
64-
vm.add_device('virtio-scsi-pci,id=scsi0,iothread=iothread0')
65-
vm.add_device('virtio-scsi-pci,id=scsi1,iothread=iothread1')
66+
vm.add_device('virtio-scsi,id=scsi0,iothread=iothread0')
67+
vm.add_device('virtio-scsi,id=scsi1,iothread=iothread1')
6668
iotests.qemu_img_create('-f', iotests.imgfmt, img0_path, str(size))
6769
iotests.qemu_img_create('-f', iotests.imgfmt, img1_path, str(size))
6870
vm.add_drive(img0_path, interface='none')

tests/qemu-iotests/common.rc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -977,5 +977,18 @@ _require_devices()
977977
done
978978
}
979979

980+
_require_one_device_of()
981+
{
982+
available=$($QEMU -M none -device help | \
983+
grep ^name | sed -e 's/^name "//' -e 's/".*$//')
984+
for device
985+
do
986+
if echo "$available" | grep -q "$device" ; then
987+
return
988+
fi
989+
done
990+
_notrun "$* not available"
991+
}
992+
980993
# make sure this script returns success
981994
true

tests/qemu-iotests/iotests.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1146,6 +1146,11 @@ def _verify_virtio_blk() -> None:
11461146
if 'virtio-blk' not in out:
11471147
notrun('Missing virtio-blk in QEMU binary')
11481148

1149+
def _verify_virtio_scsi_pci_or_ccw() -> None:
1150+
out = qemu_pipe('-M', 'none', '-device', 'help')
1151+
if 'virtio-scsi-pci' not in out and 'virtio-scsi-ccw' not in out:
1152+
notrun('Missing virtio-scsi-pci or virtio-scsi-ccw in QEMU binary')
1153+
11491154

11501155
def supports_quorum():
11511156
return 'quorum' in qemu_img_pipe('--help')

0 commit comments

Comments
 (0)