From 5640e9be5b4d5fddb045a68aeea3ea776c9404b7 Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Wed, 2 Mar 2022 10:52:06 -0500 Subject: osdict: firmware handling tweaks * Check it for test:/// URI too * Move the whole logic into osdict.requires_firmware_efi * Wrap it all in an exception handler the final API breaks us * Add some coverage exclusions since this is currently untestable Signed-off-by: Cole Robinson --- virtinst/guest.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'virtinst/guest.py') diff --git a/virtinst/guest.py b/virtinst/guest.py index 874035bb..3fb9a956 100644 --- a/virtinst/guest.py +++ b/virtinst/guest.py @@ -522,16 +522,13 @@ class Guest(XMLBuilder): arm+machvirt prefers UEFI since it's required for traditional install methods """ - if self.os.is_x86() and self.conn.is_qemu(): + if (self.os.is_x86() and + (self.conn.is_qemu() or self.conn.is_test())): # If OS has dropped support for 'bios', we have no # choice but to use EFI. # For other OS still prefer BIOS since it is faster # and doesn't break QEMU internal snapshots - has_efi = self.osinfo.supports_firmware_efi(self.os.arch) - has_bios = self.osinfo.supports_firmware_bios(self.os.arch) - log.debug("Guest osinfo firmware has_efi=%d has_bios=%d", - has_efi, has_bios) - prefer_efi = has_efi and not has_bios + prefer_efi = self.osinfo.requires_firmware_efi(self.os.arch) else: prefer_efi = self.os.is_arm_machvirt() or self.conn.is_bhyve() -- cgit v1.2.1