[SLOF] [PATCH] Fix ugly boot menu if devices have been specified with bootindex

Alexey Kardashevskiy aik at ozlabs.ru
Tue Apr 11 13:52:11 AEST 2017


On 10/04/17 19:26, Segher Boessenkool wrote:
> On Mon, Apr 10, 2017 at 05:34:58PM +1000, Alexey Kardashevskiy wrote:
>> imho aliases only make some sense when the user got just few devices,
>> preferably one of each type.
> 
> How so?  Aliases are typically set up by platform-specific code, and
> such code will know what devices to call disk0 and disk1, or enet0 until
> enet3, etc.
>
> Aliases are useful because they a) are much shorter names, and b) are
> names that make more sense to the user.

QEMU v2.9.0-rcsomething, 4 disks:

-device virtio-scsi-pci,id=vscsi0 \
-drive id=DRIVE0,if=none,file=img/fc22_16G.qcow2,format=qcow2 \
-device scsi-disk,id=scsi-disk0,drive=DRIVE0 \
-drive id=DRIVE1,if=none,file=img/u16_04_32G_htx_406.qcow2,format=qcow2 \
-device virtio-blk-pci,id=vblk0,drive=DRIVE1 \
-device spapr-vscsi,id=svscsi0 \
-drive id=DRIVE2,if=none,file=img/noprep-16g.qcow2,format=qcow2 \
-device scsi-disk,id=scsi-disk1,drive=DRIVE2,bus=svscsi0.0 \
-drive id=DRIVE3,if=none,file=img/sle12_sp1_rc2_16G.qcow2,format=qcow2 \
-device scsi-disk,id=scsi-disk2,drive=DRIVE3 \


SLOF:
0 > devalias
disk3 : /pci at 800000020000000/scsi at 2
disk2 : /pci at 800000020000000/scsi at 1/disk at 101000000000000
disk1 : /pci at 800000020000000/scsi at 1/disk at 100000000000000
usb0 : /pci at 800000020000000/usb at 0
hvterm : /vdevice/vty at 71000100
scsi : /vdevice/v-scsi at 71000001
disk : /vdevice/v-scsi at 71000001/disk at 8000000000000000
nvram : /vdevice/nvram at 71000000 ok


The command line order is:
virtio-scsi-disk-1, virtio-blk, spapr-vscsi-disk, virtio-scsi-disk-2,

The devalias order is:

spapr-vscsi-disk, virtio-scsi-disk-1, virtio-scsi-disk-2, virtio-blk.

The devalias order in QEMU v2.7.0 is (why - below):

spapr-vscsi-disk, virtio-blk, virtio-scsi-disk-1, virtio-scsi-disk-2.



The user needs to remember that:

1. SLOF scans VIO first, then it scans PCI

2. if virtio-scsi HBA happens to have smaller PCI slot number, then all
disks attached to that HBA will appear in devalias before any virtio-block

3. We actually changed the order of PCI scanning recently, it was opposite.

I fail to see how aliases make more sense here. They could help if they
were not simple diskX but vscsi0, virtioblock0, virtioscsi0, virtioscsi1
but this is not the case and it won't help in general (we can construct
really crazy machines with many PHBs, spapr-vscsi, etc).

Personally I found aliases useful for:

1. typing "boot disk" in the firmware prompt of the actual console of Apple
G5 machine - where I could not cut-n-paste - we do not care about this and
fixing SLOF for JS22 is still in my list :)

2. this list shows (more or less) what SLOF can possibly boot from so I
could cut-n-paste it to "boot
/pci at 800000020000000/scsi at 1/disk at 100000000000000" - when you cut-n-paste,
the amount of letter does not make difference :)


-- 
Alexey


More information about the SLOF mailing list