[Libguestfs] [PATCH 4/4] lib: uefi: use the efi libvirt firmware if available

Pino Toscano ptoscano at redhat.com
Thu Jan 16 12:27:05 UTC 2020


In case libvirt supports the firmware autoselection and there is an EFI
firmware available, use it directly instead of handling the firmware
manually.
---
 lib/appliance-uefi.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/lib/appliance-uefi.c b/lib/appliance-uefi.c
index d2908867c..0f07ed5a9 100644
--- a/lib/appliance-uefi.c
+++ b/lib/appliance-uefi.c
@@ -72,6 +72,15 @@ guestfs_int_get_uefi (guestfs_h *g, char *const *firmwares,
 #ifdef __aarch64__
   size_t i;
 
+  if (firmwares && firmware) {
+    for (i = 0; firmwares[i] != NULL; ++i) {
+      if (STREQ(firmwares[i], "efi")) {
+        *firmware = firmwares[i];
+        return 0;
+      }
+    }
+  }
+
   for (i = 0; guestfs_int_uefi_aarch64_firmware[i].code != NULL; ++i) {
     const char *codefile = guestfs_int_uefi_aarch64_firmware[i].code;
     const char *code_debug_file =
-- 
2.24.1




More information about the Libguestfs mailing list