On 10/12/2025 21.54, [email protected] wrote:
From: Jared Rossi <[email protected]>

Store both the device type (e.g. block) and device bus (e.g. CCW) to determine
IPL format rather than assume all devices can be identified by CCW specific
sense data.

Signed-off-by: Jared Rossi <[email protected]>
---
...
> diff --git a/include/hw/s390x/ipl/qipl.h b/include/hw/s390x/ipl/qipl.h
> index 6824391111..8199b839f0 100644
> --- a/include/hw/s390x/ipl/qipl.h
> +++ b/include/hw/s390x/ipl/qipl.h
> @@ -20,6 +20,13 @@
>   #define LOADPARM_LEN    8
>   #define NO_LOADPARM "\0\0\0\0\0\0\0\0"
>
> +#define S390_IPL_TYPE_FCP 0x00
> +#define S390_IPL_TYPE_CCW 0x02
> +#define S390_IPL_TYPE_PV 0x05
> +#define S390_IPL_TYPE_QEMU_SCSI 0xff
> +
> +#define QEMU_DEFAULT_IPL S390_IPL_TYPE_CCW

Would it make sense to turn this into an enum as well?

>   /*
>    * The QEMU IPL Parameters will be stored at absolute address
>    * 204 (0xcc) which means it is 32-bit word aligned but not
...
diff --git a/pc-bios/s390-ccw/virtio-blkdev.c b/pc-bios/s390-ccw/virtio-blkdev.c
index 4b819dd80f..f40a9407c2 100644
--- a/pc-bios/s390-ccw/virtio-blkdev.c
+++ b/pc-bios/s390-ccw/virtio-blkdev.c
...
@@ -129,6 +129,8 @@ void virtio_assume_iso9660(void)
      case VIRTIO_ID_SCSI:
          vdev->scsi_block_size = VIRTIO_ISO_BLOCK_SIZE;
          break;
+    default:
+        return;
      }
  }
@@ -139,13 +141,15 @@ void virtio_assume_eckd(void)
      vdev->guessed_disk_nature = VIRTIO_GDN_DASD;
      vdev->blk_factor = 1;
      vdev->config.blk.physical_block_exp = 0;
-    switch (vdev->senseid.cu_model) {
+    switch (vdev->dev_type) {
      case VIRTIO_ID_BLOCK:
          vdev->config.blk.blk_size = VIRTIO_DASD_DEFAULT_BLOCK_SIZE;
          break;
      case VIRTIO_ID_SCSI:
          vdev->config.blk.blk_size = vdev->scsi_block_size;
          break;
+    default:
+        return;

This looks like errors could silently be ignored here. Maybe rather panic() here instead of returning? Or use "break" to maintain the old behavior?

      }
      vdev->config.blk.geometry.heads = 15;
      vdev->config.blk.geometry.sectors =

 Thomas


Reply via email to