Hi Thomas, Sebastian,

It looks like this is simply caused by the "is_cdrom" value only ever being set to true.  I think it is a one-line fix that just makes sure to initialize the
value to false each time we try a new device:

diff --git a/pc-bios/s390-ccw/main.c b/pc-bios/s390-ccw/main.c
index a4d1c05aac..3fdba0bedc 100644
--- a/pc-bios/s390-ccw/main.c
+++ b/pc-bios/s390-ccw/main.c
@@ -214,6 +214,7 @@ static void boot_setup(void)
 static bool find_boot_device(void)
 {
     VDev *vdev = virtio_get_device();
+    vdev->is_cdrom = false;
     bool found = false;

     switch (iplb.pbt) {

I tested it with the two scenarios you mention and with the existing qtests,
and it seems to work correctly now.

Thanks for finding the mistake,
 Jared Rossi

On 10/31/24 11:50 AM, Thomas Huth wrote:
On 20/10/2024 03.29, jro...@linux.ibm.com wrote:
From: Jared Rossi <jro...@linux.ibm.com>

changes v4 -> v5:
- Fix a bug with per-deice loadparm support:
     The machine loadparm is no longer overwritten by device values, which now      allows an empty machine loadparm to propagate to later devices even if
     the primary boot device set an initial loadparm
- Fix two instances where changes were squashed into wrong patch
- Fix an instance where NULL_BLOCK_NR was returned instead of ERROR_BLOCK_NR
- Fix an instance of logical AND being used instead of bitwise AND
- Standardize all error values to be negative in all device type paths
- Minor stylistic changes and code simplification

 Hi Jared!

Our QE Sebastian also had a try with the patches today, and discovered some non-working scenarios:

Try to boot from non-working CD image first, then from a working HD image:

dd if=/dev/zero of=/tmp/zero.dat bs=1M count=10
qemu-system-s390x -nographic -accel kvm -m 2G \
 -drive if=none,id=d1,file=/tmp/zero.dat,format=raw,media=cdrom \
 -device virtio-scsi -device scsi-cd,drive=d1,bootindex=1 \
 -drive if=none,file=good-image.qcow2,id=d2 \
 -device virtio-blk,drive=d2,bootindex=2

This outputs something like the following text, then aborts:

LOADPARM=[        ]

Using virtio-scsi.
SCSI CD-ROM detected.
Failed to IPL this ISO image!
LOADPARM=[        ]

Using virtio-blk.
Failed to IPL this ISO image!
ERROR: No suitable device for IPL. Halting...

Looks like the s390-ccw bios is treating the virtio-blk device as CD-ROM in this case?

Almost the same setup, first device is again a non-working CD image, but the second device is a virtio-net device - results in the same error message (so it's likely the same or at least a very similar problem).

Could you please have a look?

 Thanks!
  Thomas



Reply via email to