diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2020-01-14 10:04:06 +0100 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2020-01-14 10:18:02 +0100 |
commit | d6bdb85eb0d73353e6df1caf586a1de523d309e2 (patch) | |
tree | 78cfa9f6e5a1f142ee6734402cf15f4a5e50700f /src | |
parent | 8d4252254a757ef61ca0b3d8fd54a95c2ce5d633 (diff) | |
download | seabios-hppa-d6bdb85eb0d73353e6df1caf586a1de523d309e2.zip seabios-hppa-d6bdb85eb0d73353e6df1caf586a1de523d309e2.tar.gz seabios-hppa-d6bdb85eb0d73353e6df1caf586a1de523d309e2.tar.bz2 |
virtio-scsi: skip initializing non-bootable devices
Check each disk attached to a virtio-scsi device whenever
it is bootable and skip initialization in case it isn't.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/hw/virtio-scsi.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/hw/virtio-scsi.c b/src/hw/virtio-scsi.c index a27bdc1..a533284 100644 --- a/src/hw/virtio-scsi.c +++ b/src/hw/virtio-scsi.c @@ -111,8 +111,18 @@ virtio_scsi_init_lun(struct virtio_lun_s *vlun, struct pci_device *pci, static int virtio_scsi_add_lun(u32 lun, struct drive_s *tmpl_drv) { + u8 skip_nonbootable = is_bootprio_strict(); struct virtio_lun_s *tmpl_vlun = container_of(tmpl_drv, struct virtio_lun_s, drive); + int prio = bootprio_find_scsi_device(tmpl_vlun->pci, tmpl_vlun->target, tmpl_vlun->lun); + + if (skip_nonbootable && prio < 0) { + dprintf(1, "skipping init of a non-bootable virtio-scsi dev at %pP," + " target %d, lun %d\n", + tmpl_vlun->pci, tmpl_vlun->target, tmpl_vlun->lun); + return -1; + } + struct virtio_lun_s *vlun = malloc_low(sizeof(*vlun)); if (!vlun) { warn_noalloc(); @@ -123,7 +133,6 @@ virtio_scsi_add_lun(u32 lun, struct drive_s *tmpl_drv) boot_lchs_find_scsi_device(vlun->pci, vlun->target, vlun->lun, &(vlun->drive.lchs)); - int prio = bootprio_find_scsi_device(vlun->pci, vlun->target, vlun->lun); int ret = scsi_drive_setup(&vlun->drive, "virtio-scsi", prio); if (ret) goto fail; |