qemu with hax to log dma reads & writes jcs.org/2018/11/12/vfio

iotests: Check for the availability of the required devices in 267 and 127

We are going to enable 127 in the "auto" group, but it only works if
virtio-scsi and scsi-hd are available - which is not the case with
QEMU binaries like qemu-system-tricore for example, so we need a
proper check for the availability of these devices here.

A very similar problem exists in iotest 267 - it has been added to
the "auto" group already, but requires virtio-blk and thus currently
fails with qemu-system-tricore for example. Let's also add aproper
check there.

Reviewed-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-id: 20200121095205.26323-5-thuth@redhat.com
Signed-off-by: Max Reitz <mreitz@redhat.com>

authored by

Thomas Huth and committed by
Max Reitz
9bdabfbe 30ad36f5

+18
+2
tests/qemu-iotests/127
··· 43 43 _supported_fmt qcow2 44 44 _supported_proto file 45 45 46 + _require_devices virtio-scsi scsi-hd 47 + 46 48 IMG_SIZE=64K 47 49 48 50 _make_test_img $IMG_SIZE
+2
tests/qemu-iotests/267
··· 46 46 # and generally impossible with external data files 47 47 _unsupported_imgopts 'refcount_bits=1[^0-9]' data_file 48 48 49 + _require_devices virtio-blk 50 + 49 51 do_run_qemu() 50 52 { 51 53 echo Testing: "$@"
+14
tests/qemu-iotests/common.rc
··· 713 713 rm "$TEST_IMG" 714 714 } 715 715 716 + # Check that a set of devices is available in the QEMU binary 717 + # 718 + _require_devices() 719 + { 720 + available=$($QEMU -M none -device help | \ 721 + grep ^name | sed -e 's/^name "//' -e 's/".*$//') 722 + for device 723 + do 724 + if ! echo "$available" | grep -q "$device" ; then 725 + _notrun "$device not available" 726 + fi 727 + done 728 + } 729 + 716 730 # make sure this script returns success 717 731 true