create: Try to default to UEFI for aarch64

If we detect AAVMF, set it up, and allow all install options.
If we don't find AAVMF, disable all options except import install (the
current behavior) and show a warning.
This commit is contained in:
Cole Robinson 2015-02-22 10:01:02 -05:00
parent 0ddec9199b
commit a5b3e2adab
2 changed files with 34 additions and 8 deletions

View File

@ -420,6 +420,21 @@ class vmmCreate(vmmGObjectUI):
installable_arch = (self.capsguest.arch in
["i686", "x86_64", "ppc64", "ia64"])
if self.capsguest.arch == "aarch64":
try:
guest = self.conn.caps.build_virtinst_guest(
self.conn.get_backend(), self.capsguest, self.capsdomain)
guest.set_uefi_default()
installable_arch = True
logging.debug("UEFI found for aarch64, setting it as default.")
except Exception, e:
installable_arch = False
logging.debug("Error checking for aarch64 UEFI default",
exc_info=True)
msg = _("Failed to setup UEFI for AArch64: %s\n"
"Install options are limited.") % e
self.startup_warning(msg)
# Install Options
method_tree = self.widget("method-tree")
method_pxe = self.widget("method-pxe")
@ -483,11 +498,10 @@ class vmmCreate(vmmGObjectUI):
self.widget("virt-install-box").set_visible(not is_container)
self.widget("container-install-box").set_visible(is_container)
show_kernel = (self.capsguest.arch not in ["x86_64", "i686"])
show_dtb = ("arm" in self.capsguest.arch or
"microblaze" in self.capsguest.arch or
"ppc" in self.capsguest.arch)
self.widget("config-kernel-box").set_visible(show_kernel)
self.widget("config-kernel-box").set_visible(not installable_arch)
uiutil.set_grid_row_visible(self.widget("config-dtb"), show_dtb)
def set_conn_state(self):
@ -1416,6 +1430,14 @@ class vmmCreate(vmmGObjectUI):
self.err.show_err(_("Error setting OS information."), e)
return None
if guest.os.is_arm64():
try:
guest.set_uefi_default()
except:
# If this errors we will have already informed the user
# on page 1.
pass
# Set up default devices
try:
guest.default_graphics_type = self.config.get_graphics_type()

View File

@ -79,15 +79,19 @@ class _Devices(_CapsBlock):
class DomainCapabilities(XMLBuilder):
@staticmethod
def build_from_guest(guest):
if not guest.conn.check_support(
guest.conn.SUPPORT_CONN_DOMAIN_CAPABILITIES):
def build_from_params(conn, emulator, arch, machine, hvtype):
if not conn.check_support(
conn.SUPPORT_CONN_DOMAIN_CAPABILITIES):
# If not supported, just use a stub object
return DomainCapabilities(guest.conn)
return DomainCapabilities(conn)
xml = guest.conn.getDomainCapabilities(
xml = conn.getDomainCapabilities(emulator, arch, machine, hvtype)
return DomainCapabilities(conn, parsexml=xml)
@staticmethod
def build_from_guest(guest):
return DomainCapabilities.build_from_params(guest.conn,
guest.emulator, guest.os.arch, guest.os.machine, guest.type)
return DomainCapabilities(guest.conn, parsexml=xml)
# Mapping of UEFI binary names to their associated architectures. We
# only use this info to do things automagically for the user, it shouldn't