diff mbox

[edk2,5/6] OvmfPkg, ArmVirtPkg: clean up SetBootOrderFromQemu() parameter list

Message ID 1463515156-26780-6-git-send-email-lersek@redhat.com
State New
Headers show

Commit Message

Laszlo Ersek May 17, 2016, 7:59 p.m. UTC
With OvmfPkg's original QemuBootOrderLib (and USE_OLD_BDS) gone, we no
longer need the BootOptionList parameter in the SetBootOrderFromQemu()
prototype. Update the library class header file (including the function's
documentation), and adapt the library instance and the call sites.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Gary Ching-Pang Lin <glin@suse.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>

---
 OvmfPkg/Include/Library/QemuBootOrderLib.h             | 11 +++++------
 ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c |  2 +-
 OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c   |  2 +-
 OvmfPkg/Library/QemuNewBootOrderLib/QemuBootOrderLib.c | 20 +++++---------------
 4 files changed, 12 insertions(+), 23 deletions(-)

-- 
1.8.3.1


_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
diff mbox

Patch

diff --git a/OvmfPkg/Include/Library/QemuBootOrderLib.h b/OvmfPkg/Include/Library/QemuBootOrderLib.h
index 80d02c80c260..743a71782471 100644
--- a/OvmfPkg/Include/Library/QemuBootOrderLib.h
+++ b/OvmfPkg/Include/Library/QemuBootOrderLib.h
@@ -26,12 +26,11 @@ 
 
   Attempt to retrieve the "bootorder" fw_cfg file from QEMU. Translate the
   OpenFirmware device paths therein to UEFI device path fragments. Match the
-  translated fragments against BootOptionList, and rewrite the BootOrder NvVar
-  so that it corresponds to the order described in fw_cfg.
-
-  @param[in] BootOptionList  A boot option list, created with
-                             BdsLibEnumerateAllBootOption ().
+  translated fragments against the current list of boot options, and rewrite
+  the BootOrder NvVar so that it corresponds to the order described in fw_cfg.
 
+  Platform BDS should call this function after EfiBootManagerConnectAll () and
+  EfiBootManagerRefreshAllBootOption () return.
 
   @retval RETURN_SUCCESS            BootOrder NvVar rewritten.
 
@@ -51,7 +50,7 @@ 
 **/
 RETURN_STATUS
 SetBootOrderFromQemu (
-  IN  CONST LIST_ENTRY *BootOptionList
+  VOID
   );
 
 
diff --git a/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c b/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c
index d4bfcd0c0715..cc6d21e30007 100644
--- a/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c
+++ b/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c
@@ -551,7 +551,7 @@  PlatformBootManagerAfterConsole (
   // the QEMU configuration.
   //
   EfiBootManagerRefreshAllBootOption ();
-  SetBootOrderFromQemu (NULL);
+  SetBootOrderFromQemu ();
 }
 
 /**
diff --git a/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c b/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c
index a16453d289de..da4cb728c678 100644
--- a/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c
+++ b/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c
@@ -1305,7 +1305,7 @@  Routine Description:
     PcdGetPtr (PcdShellFile), L"EFI Internal Shell", LOAD_OPTION_ACTIVE
     );
 
-  SetBootOrderFromQemu (NULL);
+  SetBootOrderFromQemu ();
 }
 
 /**
diff --git a/OvmfPkg/Library/QemuNewBootOrderLib/QemuBootOrderLib.c b/OvmfPkg/Library/QemuNewBootOrderLib/QemuBootOrderLib.c
index c5f165ae4e23..86082301a8f5 100644
--- a/OvmfPkg/Library/QemuNewBootOrderLib/QemuBootOrderLib.c
+++ b/OvmfPkg/Library/QemuNewBootOrderLib/QemuBootOrderLib.c
@@ -1696,12 +1696,11 @@  PruneBootVariables (
 
   Attempt to retrieve the "bootorder" fw_cfg file from QEMU. Translate the
   OpenFirmware device paths therein to UEFI device path fragments. Match the
-  translated fragments against BootOptionList, and rewrite the BootOrder NvVar
-  so that it corresponds to the order described in fw_cfg.
-
-  @param[in] BootOptionList  A boot option list, created with
-                             BdsLibEnumerateAllBootOption ().
+  translated fragments against the current list of boot options, and rewrite
+  the BootOrder NvVar so that it corresponds to the order described in fw_cfg.
 
+  Platform BDS should call this function after EfiBootManagerConnectAll () and
+  EfiBootManagerRefreshAllBootOption () return.
 
   @retval RETURN_SUCCESS            BootOrder NvVar rewritten.
 
@@ -1721,7 +1720,7 @@  PruneBootVariables (
 **/
 RETURN_STATUS
 SetBootOrderFromQemu (
-  IN  CONST LIST_ENTRY *BootOptionList
+  VOID
   )
 {
   RETURN_STATUS                    Status;
@@ -1741,15 +1740,6 @@  SetBootOrderFromQemu (
   EFI_BOOT_MANAGER_LOAD_OPTION     *BootOptions;
   UINTN                            BootOptionCount;
 
-  //
-  // The QemuBootOrderLib is linked by OvmfPkg and ArmVirtPkg.
-  // OvmfPkg was changed to use the new BDS @ MdeModulePkg, so boot options
-  // are no longer stored in linked list.
-  // But we don't change the QemuBootOrderLib class interface because
-  // ArmVirtPkg are still using old BDS @ IntelFrameworkModulePkg.
-  //
-  ASSERT (BootOptionList == NULL);
-
   Status = QemuFwCfgFindFile ("bootorder", &FwCfgItem, &FwCfgSize);
   if (Status != RETURN_SUCCESS) {
     return Status;