Le 19/03/2021 à 15:23, Cornelia Huck a écrit : > On Fri, 19 Mar 2021 14:51:59 +0100 > Laurent Vivier <laur...@vivier.eu> wrote: > >> Le 19/03/2021 à 14:36, Philippe Mathieu-Daudé a écrit : >>> On 3/19/21 2:25 PM, Laurent Vivier wrote: >>>> 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 <laur...@vivier.eu> >>>> --- >>>> tests/qemu-iotests/127 | 3 ++- >>>> tests/qemu-iotests/256 | 6 ++++-- >>>> tests/qemu-iotests/iotests.py | 5 +++++ >>>> 3 files changed, 11 insertions(+), 3 deletions(-) >>>> >>>> diff --git a/tests/qemu-iotests/127 b/tests/qemu-iotests/127 >>>> index 98e8e82a8210..abe24861100d 100755 >>>> --- a/tests/qemu-iotests/127 >>>> +++ b/tests/qemu-iotests/127 >>>> @@ -44,7 +44,8 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 >>>> _supported_fmt qcow2 >>>> _supported_proto file fuse >>>> >>>> -_require_devices virtio-scsi scsi-hd >>>> +_require_devices scsi-hd >>>> +_require_devices virtio-scsi-pci || _require_devices virtio-scsi-ccw >> >> Re-reading the code, I think this cannot work because we have an "exit" if >> the test fails. > > We could try to make _require_devices accept alternatives, but that is > probably overkill... > >> >> The test is executed anyway because s390x provides virtio-scsi-ccw and >> virtio-scsi-pci. > > ...because of this. > > Maybe just add a comment that we require pci or ccw because iothreads > depend on ioventfd, but checking for pci is enough, as we have pci when > we have ccw? >
Well... bash is fun: _require_one_device_of() { available=$($QEMU -M none -device help | \ grep ^name | sed -e 's/^name "//' -e 's/".*$//') for device do if echo "$available" | grep -q "$device" ; then return fi done _notrun "$* not available" } and: _require_one_device_of virtio-scsi-pci virtio-scsi-ccw Thanks, Laurent