Am 19.01.2024 um 13:55 hat Peter Maydell geschrieben: > If you build QEMU with support for the sh4 target only > (configure --target-list=sh4-softmmu) then 'make check' fails > in the iotests, because some iotests, including for instance 040, > try to create a machine with a virtio-scsi device, but they don't > do anything to ensure that the machine they create actually > has a PCI bus to plug the virtio-scsi device into, and so the test > fails: > > +Traceback (most recent call last): > + File "/mnt/nvmedisk/linaro/qemu-from-laptop/qemu/tests/qemu-iotests/040", > line 94, in setUp > + self.vm.launch() > + File > "/mnt/nvmedisk/linaro/qemu-from-laptop/qemu/python/qemu/machine/machine.py", > line 455, in launch > + raise VMLaunchFailure( > +qemu.machine.machine.VMLaunchFailure: ConnectError: Failed to > establish session: EOFError > + Exit code: 1 > + Command: > /mnt/nvmedisk/linaro/qemu-from-laptop/qemu/build/sh4/qemu-system-sh4 > -display none -vga none -chardev socket,id=mon,fd=5 -mon > chardev=mon,mode=control -chardev socket,id=qtest,fd=3 -qtest > chardev:qtest -accel qtest -nodefaults -display none -accel qtest > -drive > if=none,id=drive0,file=/mnt/nvmedisk/linaro/qemu-from-laptop/qemu/build/sh4/scratch/qcow2-file-040/test.img,format=qcow2,cache=writeback,aio=threads,node-name=top,backing.node-name=mid,backing.backing.node-name=base > -device virtio-scsi -device scsi-hd,id=scsi0,drive=drive0 > + Output: [I 0.000000] OPENED > +qemu-system-sh4: -device virtio-scsi: No 'PCI' bus found for device > 'virtio-scsi-pci' > > (It happens that the default machine type for 'sh4' > does not have a PCI bus.) > > How are the iotests supposed to select a machine model to run > on, and how are they intended to mark themselves as requiring > particular facilities, like PCI? Presumably some of the tests > are missing the appropriate annotations to ensure they're > skipped when the facilities required aren't present.
Probably next to nobody builds only sh4 and then runs 'make check'... I think the following patch should fix this test case (but as nobody ever tested it, I fully expect other cases to fail, too). The fix could of course be a lot more fine grained and skip only some individual tests instead of all of them. I doubt we care, though, as long as it passes. iotests use machine_map in tests/qemu-iotests/testenv.py to decide which machine to use for which target (unless the individual test case overrides that). If the target isn't the list, it gets the default machine type. Kevin diff --git a/tests/qemu-iotests/040 b/tests/qemu-iotests/040 index 5c18e413ec..19f0bb1010 100755 --- a/tests/qemu-iotests/040 +++ b/tests/qemu-iotests/040 @@ -952,5 +952,6 @@ class TestCommitWithOverriddenBacking(iotests.QMPTestCase): self.vm.event_wait('BLOCK_JOB_COMPLETED') if __name__ == '__main__': + iotests.verify_virtio_scsi_pci_or_ccw() iotests.main(supported_fmts=['qcow2', 'qed'], supported_protocols=['file'])