]> xenbits.xensource.com Git - osstest/seabios.git/commitdiff
virtio-scsi: fix boot prio detection by using correct lun
authorStefan Reiter <s.reiter@proxmox.com>
Mon, 27 Jul 2020 13:14:15 +0000 (15:14 +0200)
committerKevin O'Connor <kevin@koconnor.net>
Tue, 28 Jul 2020 15:35:59 +0000 (11:35 -0400)
Commits

  d6bdb85eb0 virtio-scsi: skip initializing non-bootable devices
  f82e82a5ab2 virtio-mmio: add support for scsi devices.

both use the lun value from tmpl_drv, which is always 0, instead of the
correct one passed as a separate parameter. This causes systems where
LUNs other than 0 are set as bootable, but 0 is not, to not boot.

Reviewed-by: Paul Menzel <pmenzel@molgen.mpg.de>
Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
src/hw/virtio-scsi.c

index 59f1c654d76b471463bf2992d8d4d8c280ca481e..369c98131aed1c021cddb8b6091207abb951cc0d 100644 (file)
@@ -126,14 +126,14 @@ virtio_scsi_add_lun(u32 lun, struct drive_s *tmpl_drv)
     int prio = -1;
 
     if (tmpl_vlun->pci)
-        prio = bootprio_find_scsi_device(tmpl_vlun->pci, tmpl_vlun->target, tmpl_vlun->lun);
+        prio = bootprio_find_scsi_device(tmpl_vlun->pci, tmpl_vlun->target, lun);
     if (tmpl_vlun->mmio)
-        prio = bootprio_find_scsi_mmio_device(tmpl_vlun->mmio, tmpl_vlun->target, tmpl_vlun->lun);
+        prio = bootprio_find_scsi_mmio_device(tmpl_vlun->mmio, tmpl_vlun->target, lun);
 
     if (skip_nonbootable && prio < 0) {
         dprintf(1, "skipping init of a non-bootable virtio-scsi dev at %s,"
                 " target %d, lun %d\n",
-                tmpl_vlun->name, tmpl_vlun->target, tmpl_vlun->lun);
+                tmpl_vlun->name, tmpl_vlun->target, lun);
         return -1;
     }