]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg/DeviceManagerUiLib: connect all before creating menu page
authorArd Biesheuvel <ard.biesheuvel@arm.com>
Wed, 8 Apr 2020 17:23:27 +0000 (19:23 +0200)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Thu, 30 Apr 2020 07:51:10 +0000 (07:51 +0000)
The device manager UI library creates a UiApp submenu that contains a
list of network devices in the system. The logic that creates this menu
assumes that all handles have been connected to their drivers, but this
is not guaranteed in the general case: due to the way UiApp is constructed,
this logic runs before the UiApp entrypoint is invoked, which is where
ConnectAll() is normally called to ensure that all existing controllers
are connected to their drivers. Moving this call into DeviceManagerUiLib
is not an option, since it is incorporated into UiApp via NULL library
class resolution, and so it may not be included to begin with.

So work around this by doing an explicit additional ConnectAll() before
populating the pages.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@arm.com>
Link: https://edk2.groups.io/g/devel/topic/72879609#57075
Reviewed-by: Dandan Bi <dandan.bi@intel.com>
MdeModulePkg/Library/DeviceManagerUiLib/DeviceManager.c
MdeModulePkg/Library/DeviceManagerUiLib/DeviceManager.h
MdeModulePkg/Library/DeviceManagerUiLib/DeviceManagerUiLib.inf

index 0540e6fa8a44dcb2a361c0e08190cb2d59b6c0ca..3bc13d34077558160f9b06b1fd299532764a5b8a 100644 (file)
@@ -892,6 +892,13 @@ DeviceManagerUiLibConstructor (
                   );\r
   ASSERT (gDeviceManagerPrivate.HiiHandle != NULL);\r
 \r
+  //\r
+  // The device manager form contains a page listing all the network\r
+  // controllers in the system. This list can only be populated if all\r
+  // handles have been connected, so do it here.\r
+  //\r
+  EfiBootManagerConnectAll ();\r
+\r
   //\r
   // Update boot manager page\r
   //\r
index 22fe12d2a5e88da6df304ce708fde3a73d0e0e96..c53c2a1a0e1a8daa7a40a2c55cbdb0dc61e2574e 100644 (file)
@@ -23,6 +23,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 #include <Library/BaseLib.h>\r
 #include <Library/HiiLib.h>\r
 #include <Library/DevicePathLib.h>\r
+#include <Library/UefiBootManagerLib.h>\r
 #include <Library/UefiHiiServicesLib.h>\r
 \r
 //\r
index cb01b3b85180e8160753be6fa2052fcfda29ff79..d7f833d8b23a5ff1a952162699ba9122a3738602 100644 (file)
@@ -40,6 +40,7 @@
   DebugLib\r
   PrintLib\r
   HiiLib\r
+  UefiBootManagerLib\r
   UefiHiiServicesLib\r
 \r
 [Guids]\r