The patch uses EfiBootManagerRefreshAllBootOption() to collect
all boot options and uses SetBootOrderFromQemu exposed by
QemuNewBootOrderLib to adjust the boot option order.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu...@intel.com>
Reviewed-by: Laszlo Ersek <ler...@redhat.com>
---
 OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c | 11 +++--------
 OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.h |  1 +
 2 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c 
b/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c
index fcb39a0..c3812fd 100644
--- a/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c
+++ b/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c
@@ -14,7 +14,6 @@
 
 #include "BdsPlatform.h"
 #include <Guid/RootBridgesConnectedEventGroup.h>
-#include <Library/QemuBootOrderLib.h>
 
 
 //
@@ -1390,14 +1389,10 @@ Routine Description:
   // Process QEMU's -kernel command line option
   //
   TryRunningQemuKernel ();
-  BdsLibEnumerateAllBootOption (BootOptionList);
 
-  SetBootOrderFromQemu (BootOptionList);
-  //
-  // The BootOrder variable may have changed, reload the in-memory list with
-  // it.
-  //
-  BdsLibBuildOptionFromVar (BootOptionList, L"BootOrder");
+  EfiBootManagerRefreshAllBootOption ();
+
+  SetBootOrderFromQemu (NULL);
 }
 
 /**
diff --git a/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.h 
b/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.h
index b14410c..4950d3a 100644
--- a/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.h
+++ b/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.h
@@ -47,6 +47,7 @@ Abstract:
 #include <Library/IoLib.h>
 #include <Library/NvVarsFileLib.h>
 #include <Library/QemuFwCfgLib.h>
+#include <Library/QemuBootOrderLib.h>
 
 #include <Protocol/Decompress.h>
 #include <Protocol/PciIo.h>
-- 
2.7.0.windows.1

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

Reply via email to