[gnome-boxes] vm-configurator: Add supports_efi()



commit 4f71f40dcf06479024387efe6802cf04721f9e93
Author: Fabiano FidĂȘncio <fidencio redhat com>
Date:   Mon Aug 26 20:31:33 2019 +0300

    vm-configurator: Add supports_efi()
    
    UEFI support depends on two things:
    - Host side:
      Having the firmwares available, which is an information provided by
      libvirt;
    - Guest side:
      OS being able to boot on UEFI firmware, which is an information
      provided by osinfo-db;
    
    supports_efi() method evaluates whether those two dependencies can be
    satisfied.
    
    https://gitlab.gnome.org/GNOME/gnome-boxes/issues/199
    
    Signed-off-by: Fabiano FidĂȘncio <fidencio redhat com>

 src/vm-configurator.vala | 10 ++++++++++
 1 file changed, 10 insertions(+)
---
diff --git a/src/vm-configurator.vala b/src/vm-configurator.vala
index 1b36a757..68cb0bd1 100644
--- a/src/vm-configurator.vala
+++ b/src/vm-configurator.vala
@@ -381,6 +381,16 @@ private static bool domain_caps_supports_efi (DomainCapabilities domain_caps) {
         return false;
     }
 
+    private static bool supports_efi (InstallerMedia install_media, DomainCapabilities domain_caps) {
+        if (install_media == null || !install_media.supports_efi)
+            return false;
+
+        if (domain_caps == null || !domain_caps_supports_efi (domain_caps))
+            return false;
+
+        return true;
+    }
+
     private static void set_os_config (Domain domain, InstallerMedia install_media, CapabilitiesGuest 
guest_caps, DomainCapabilities domain_caps) {
         var os = new DomainOs ();
         os.set_os_type (DomainOsType.HVM);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]