]> xenbits.xensource.com Git - seabios.git/commitdiff
nvme: skip initializing non-bootable devices
authorGerd Hoffmann <kraxel@redhat.com>
Tue, 14 Jan 2020 09:12:01 +0000 (10:12 +0100)
committerGerd Hoffmann <kraxel@redhat.com>
Tue, 14 Jan 2020 09:20:31 +0000 (10:20 +0100)
Check NVMe devices whenever they are bootable,
skip initialization in case they are not.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
src/hw/nvme.c

index 2e3aa38682c4f54022700ceec2196faf692cd34b..41f3b768528e2736ab53453a9cea56c70c8141e1 100644 (file)
@@ -586,8 +586,15 @@ nvme_controller_enable(struct nvme_ctrl *ctrl)
 static void
 nvme_controller_setup(void *opaque)
 {
+    u8 skip_nonbootable = is_bootprio_strict();
     struct pci_device *pci = opaque;
 
+    if (skip_nonbootable && bootprio_find_pci_device(pci) < 0) {
+        dprintf(1, "skipping init of a non-bootable NVMe at %pP\n",
+                pci);
+        goto err;
+    }
+
     struct nvme_reg volatile *reg = pci_enable_membar(pci, PCI_BASE_ADDRESS_0);
     if (!reg)
         return;