On 8/31/2026 3:49 PM, [email protected] wrote:
From: Jared Rossi <[email protected]>
Add a test to verify that a guest can use a PCI controlled CD as a fallback boot
device after a failed CCW IPL.
Signed-off-by: Jared Rossi <[email protected]>
---
tests/qtest/cdrom-test.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/tests/qtest/cdrom-test.c b/tests/qtest/cdrom-test.c
index a65854d2bc..ab34930404 100644
--- a/tests/qtest/cdrom-test.c
+++ b/tests/qtest/cdrom-test.c
@@ -253,6 +253,14 @@ static void add_s390x_tests(void)
"-drive if=none,id=d1,media=cdrom,file=",
test_cdboot);
}
+ if (qtest_has_device("virtio-scsi-pci")) {
+ qtest_add_data_func("cdrom/boot/pci-scsi-fallback-from-blk-ccw",
+ "-device virtio-scsi-pci -device virtio-serial "
+ "-device virtio-blk-ccw,drive=d1,bootindex=1 "
+ "-drive driver=null-co,read-zeroes=on,if=none,id=d1
"
+ "-device scsi-cd,drive=d2,bootindex=2 "
+ "-drive if=none,id=d2,media=cdrom,file=",
test_cdboot);
+ }
}
int main(int argc, char **argv)
Tested-by: Joshua Daley <[email protected]>
Note: need to install xorriso to run these tests. If it is not installed, they
will not run, with no indication of why. In cdrom-test.c:main(), if the
exec_xorrisofs check fails, we return g_test_run() early, without having added
any subtests. Maybe a separate patch can add a message that is printed in that
case.
meson test --suite qtest-s390x 'qtest-s390x/cdrom-test'
...
# starting QEMU: exec ./qemu-system-s390x -qtest unix:/tmp/qtest-185425.sock
-qtest-log /dev/null -chardev socket,path=/tmp/qtest-185425.qmp,id=char0
-object monitor-qmp,id=qmp0,chardev=char0 -display none -audio none -run-with
exit-with-parent=on -accel kvm -accel tcg -no-shutdown -device virtio-scsi-pci
-device virtio-serial -device virtio-blk-ccw,drive=d1,bootindex=1 -drive
driver=null-co,read-zeroes=on,if=none,id=d1 -device
scsi-cd,drive=d2,bootindex=2 -drive
if=none,id=d2,media=cdrom,file=cdrom-boot-iso-g8yma5 -accel qtest
ok 8 /s390x/cdrom/boot/pci-scsi-fallback-from-blk-ccw
Also, I was able to boot via virtio-scsi-pci manually:
qemu-system-s390x \
-nographic \
-accel kvm \
-m 1024 \
-machine s390-ccw-virtio \
-drive file=Fedora-Server-dvd-s390x-43-1.6.iso,media=cdrom,if=none,id=cdrom0 \
-device virtio-scsi-pci \
-device scsi-cd,drive=cdrom0,bootindex=1