Contributed-under: TianoCore Contribution Agreement 1.0

Signed-off-by: Laszlo Ersek <ler...@redhat.com>
---
 OvmfPkg/Library/PlatformBdsLib/QemuBootOrder.c |   26 ++++++++++++++++++++++++
 1 files changed, 26 insertions(+), 0 deletions(-)

diff --git a/OvmfPkg/Library/PlatformBdsLib/QemuBootOrder.c 
b/OvmfPkg/Library/PlatformBdsLib/QemuBootOrder.c
index ebec938..1c5db66 100644
--- a/OvmfPkg/Library/PlatformBdsLib/QemuBootOrder.c
+++ b/OvmfPkg/Library/PlatformBdsLib/QemuBootOrder.c
@@ -606,6 +606,32 @@ TranslateOfwNodes (
       PciDevFun[1],
       AcpiUid
       );
+  } else if (NumNodes >= 3 &&
+             SubstringEq (OfwNode[1].DriverName, "scsi") &&
+             SubstringEq (OfwNode[2].DriverName, "disk")
+             ) {
+    //
+    // OpenFirmware device path (virtio-blk disk):
+    //
+    //   /pci@i0cf8/scsi@6[,3]/disk@0,0
+    //        ^          ^  ^       ^ ^
+    //        |          |  |       fixed
+    //        |          |  PCI function corresponding to disk (optional)
+    //        |          PCI slot holding disk
+    //        PCI root at system bus port, PIO
+    //
+    // UEFI device path prefix:
+    //
+    //   PciRoot(0x0)/Pci(0x6,0x0)/HD( -- if PCI function is 0 or absent
+    //   PciRoot(0x0)/Pci(0x6,0x3)/HD( -- if PCI function is present and 
nonzero
+    //
+    Written = UnicodeSPrintAsciiFormat (
+      Translated,
+      *TranslatedSize * sizeof (*Translated), // BufferSize in bytes
+      "PciRoot(0x0)/Pci(0x%x,0x%x)/HD(",
+      PciDevFun[0],
+      PciDevFun[1]
+      );
   } else {
     return RETURN_UNSUPPORTED;
   }
-- 
1.7.1


------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://ad.doubleclick.net/clk;258768047;13503038;j?
http://info.appdynamics.com/FreeJavaPerformanceDownload.html
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to