[SeaBIOS] [PATCH] virtio-scsi: fix boot prio detection by using correct lun

Stefan Reiter posted 1 patch 3 years, 9 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/seabios tags/patchew/20200727124754.18743-1-s.reiter@proxmox.com
There is a newer version of this series
src/hw/virtio-scsi.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
[SeaBIOS] [PATCH] virtio-scsi: fix boot prio detection by using correct lun
Posted by Stefan Reiter 3 years, 9 months ago
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 seperate parameter. This causes systems where
LUNs other than 0 are set as bootable, but 0 is not, to not boot.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
---
 src/hw/virtio-scsi.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/hw/virtio-scsi.c b/src/hw/virtio-scsi.c
index 59f1c65..369c981 100644
--- a/src/hw/virtio-scsi.c
+++ b/src/hw/virtio-scsi.c
@@ -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;
     }
 
-- 
2.20.1

_______________________________________________
SeaBIOS mailing list -- seabios@seabios.org
To unsubscribe send an email to seabios-leave@seabios.org
[SeaBIOS] Re: [PATCH] virtio-scsi: fix boot prio detection by using correct lun
Posted by Paul Menzel 3 years, 9 months ago
Dear Stefan,


Am 27.07.20 um 14:47 schrieb Stefan Reiter:
> 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 seperate parameter. This causes systems where

sep*a*rate

> LUNs other than 0 are set as bootable, but 0 is not, to not boot.
> 
> Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
> ---
>   src/hw/virtio-scsi.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/src/hw/virtio-scsi.c b/src/hw/virtio-scsi.c
> index 59f1c65..369c981 100644
> --- a/src/hw/virtio-scsi.c
> +++ b/src/hw/virtio-scsi.c
> @@ -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;
>       }

Reviewed-by: Paul Menzel <pmenzel@molgen.mpg.de>


Kind regards,

Paul
_______________________________________________
SeaBIOS mailing list -- seabios@seabios.org
To unsubscribe send an email to seabios-leave@seabios.org