On 11/14/24 7:29 AM, Thomas Huth wrote:
While adding the new flexible boot order feature on s390x recently,
we missed to add the "loadparm" property to the scsi-hd and scsi-cd
devices. This property is required on s390x to pass the information
to the boot loader about which kernel should be started or whether
the boot menu should be shown. But even more serious: The missing
property is now causing trouble with the corresponding libvirt patches
that assume that the "loadparm" property is either settable for all
bootable devices (when the "boot order" feature is implemented in
QEMU), or none (meaning the behaviour of older QEMUs that only allowed
one "loadparm" at the machine level). To fix this broken situation,
let's implement the "loadparm" property for the SCSI devices, too.
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
NB: Unlike the ccw_device_set_loadparm() logic that we use for CCW
devices, I've decided to use a string property for the "loadparm"
in the SCSI devices to avoid spoiling the common code with too much
s390x logic. So the check for valid characters is now done after the
property has been set, i.e. we only print out an error instead of
forbidding the setting (like we do it with the CCW devices), which
is IMHO still perfectly acceptable. Or are there other opinions?
I wasn't able to think of a way to abuse passing invalid characters, but I did
find two additional differences about the string approach:
a) it is not possible to override the machine loadparm by assigning an empty
string (loadparm="") to the device
Assigning a loadparm to a non-boot device generally does nothing, but in the
case of device probing (i.e. no boot devices assigned at all), the device with
the loadparm assigned could be selected for IPL, but it will not use the
assigned loadparm (because no IPLB was generated for the device). This check is
normally handled by ccw_device_set_loadparm(), but I'm not sure if there is a
way to do the validation without having a setter function for the property.