[virt-manager PATCH 2/2] virtinst: bhyve: properly configure loader

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

 



Bhyve requires explicit loader configuration. So query
domain capabilities, try to find the "official"
firmware and configure all the necessary loader options.

Signed-off-by: Roman Bogorodskiy <bogorodskiy@xxxxxxxxx>
---
 virtinst/domain/os.py | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/virtinst/domain/os.py b/virtinst/domain/os.py
index 59fbc43e..4a9fbc81 100644
--- a/virtinst/domain/os.py
+++ b/virtinst/domain/os.py
@@ -127,3 +127,19 @@ class DomainOs(XMLBuilder):
                 self.init = "/sbin/init"
             else:
                 self.init = "/bin/sh"
+        if self.conn.is_bhyve():
+            dom_caps = guest.lookup_domcaps()
+            firmware_files = [f.value for f in dom_caps.os.loader.values]
+            if not firmware_files:
+                return
+            # Prefer the known BHYVE_UEFI.fd firmware
+            # from the sysutils/bhyve-firmware port. If not found,
+            # just pick the first one
+            firmware_file = None
+            for f in firmware_files:
+                if 'BHYVE_UEFI.fd' in f:
+                    firmware_file = f
+                    break
+            self.loader = firmware_file or firmware_files[0]
+            self.loader_type = "pflash"
+            self.loader_ro = True
-- 
2.30.0




[Index of Archives]     [Linux Virtualization]     [KVM Development]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux