The first patch cleans up a confusing / outdated comment in
BdsPlatform.c, and removes remnants of an old boot mode hack that has
been irrelevant for OVMF for a while.

The second patch makes sure that QemuBootOrder doesn't only drop
references to Boot#### variables in BootOrder, but it also releases the
unreferenced (leaked, unreachable) variables themselves.

Testing:
(a) Booted a Fedora guest with a pre-patch OVMF build three consecutive
times. Listed the files under "/sys/firmware/efi/efivars/". Compared
the set of boot variables. Results:

  --- no-patch-1.txt      2014-02-24 17:38:18.150337706 +0100
  +++ no-patch-2.txt      2014-02-24 17:39:01.559729815 +0100
  @@ -287,6 +287,9 @@
   Boot011D-8be4df61-93ca-11d2-aa0d-00e098032b8c
   Boot011E-8be4df61-93ca-11d2-aa0d-00e098032b8c
   Boot011F-8be4df61-93ca-11d2-aa0d-00e098032b8c
  +Boot0120-8be4df61-93ca-11d2-aa0d-00e098032b8c
  +Boot0121-8be4df61-93ca-11d2-aa0d-00e098032b8c
  +Boot0122-8be4df61-93ca-11d2-aa0d-00e098032b8c
   BootCurrent-8be4df61-93ca-11d2-aa0d-00e098032b8c
   BootOptionSupport-8be4df61-93ca-11d2-aa0d-00e098032b8c
   BootOrder-8be4df61-93ca-11d2-aa0d-00e098032b8c

and

  --- no-patch-2.txt      2014-02-24 17:39:01.559729815 +0100
  +++ no-patch-3.txt      2014-02-24 17:40:12.290521928 +0100
  @@ -290,6 +290,9 @@
   Boot0120-8be4df61-93ca-11d2-aa0d-00e098032b8c
   Boot0121-8be4df61-93ca-11d2-aa0d-00e098032b8c
   Boot0122-8be4df61-93ca-11d2-aa0d-00e098032b8c
  +Boot0123-8be4df61-93ca-11d2-aa0d-00e098032b8c
  +Boot0124-8be4df61-93ca-11d2-aa0d-00e098032b8c
  +Boot0125-8be4df61-93ca-11d2-aa0d-00e098032b8c
   BootCurrent-8be4df61-93ca-11d2-aa0d-00e098032b8c
   BootOptionSupport-8be4df61-93ca-11d2-aa0d-00e098032b8c
   BootOrder-8be4df61-93ca-11d2-aa0d-00e098032b8c

(b) Rebuilt OVMF with the patchset and repeated the test in (a) -- three
further runs. The set of boot variables stagnated, relative to the last
output under step (a). (Leak had been plugged.)

(c) Regression testing:

- Removed the PXE boot option I used to have in the 2nd position for the
  guest, and booted the guest. The option was dropped.

- Then I shut down the VM, re-added the PXE boot option in the 1st
  position, and rebooted. The MAC devpath was automatically
  re-enumerated, and the qemu-specific code moved it to the 1st
  position. Booted the UEFI shell from local libvirt network.

- Then I shut down the VM, reordered the HD and PXE boot options in
  virt-manager, and booted again from the HD. The PXE boot option moved
  to 2nd place.

Please test and/or review.
Thanks!
Laszlo

Laszlo Ersek (2):
  OvmfPkg: BDS: remove historic (now defunct) boot mode hack
  OvmfPkg: BDS: QemuBootOrder: don't leak unreferenced boot options

 OvmfPkg/Library/PlatformBdsLib/BdsPlatform.c   | 20 ++--------
 OvmfPkg/Library/PlatformBdsLib/QemuBootOrder.c | 54 +++++++++++++++++++++++---
 2 files changed, 51 insertions(+), 23 deletions(-)

-- 
1.8.3.1


------------------------------------------------------------------------------
Flow-based real-time traffic analytics software. Cisco certified tool.
Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
Customize your own dashboards, set traffic alerts and generate reports.
Network behavioral analysis & security monitoring. All-in-one tool.
http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to