On 10/25/21 7:00 PM, Charles Arnold wrote:
> From d30b50139e60afc6e5da1e38f130b27859d31a83 Mon Sep 17 00:00:00 2001
> From: Charles Arnold <carnold@xxxxxxxx>
> Date: Mon, 25 Oct 2021 16:16:06 -0600
> Subject: virt-manager: Add firmware preferences for creating a new VM
>
> Possible values are BIOS (default) and UEFI.
> The firmware used is determined by libvirt unless a specific firmware is
> selected from the Customize dialog.
>
> See https://bugzilla.redhat.com/show_bug.cgi?id=1997882
>
Thanks, this seems mostly okay, but I think we need to make this x86
only. Other arches either have no UEFI support, or from virt-manager's
perspective _only_ have UEFI support (aarch64 + arm32 machvirt). So the
internal field and the UI should make it clear this is x86.
The preference UI fields should just be 'System default' and "UEFI".
BIOS value isn't actually handled anywhere in create.py, and we don't
want to provide that option anyways IMO: Eventually when win11 is
supported in osinfo-db, the only option will be UEFI, which means we
would have to error if bios is requested. If we ever start choosing to
set UEFI by default for OS that support both BIOS and UEFI then we can
consider adding a BIOS option here.
In some prep patches I changed virtinst/guest.py to use
os.firmware='efi' if libvirt is new enough, when UEFI is requested. The
attached diff on top of your patch will use that infrastructure, and
give some upfront error reporting if for example it appears uefi is not
available.
If you're cool with those changes I can make them and push, or you can
send a v2
Thanks
Cole
commit 5d705e47e78bc92b2a1f5e8b5d1e5634417d5b93
Author: Cole Robinson <crobinso@xxxxxxxxxx>
Date: Wed Jan 26 14:44:18 2022 -0500
colediff
Signed-off-by: Cole Robinson <crobinso@xxxxxxxxxx>
diff --git a/virtManager/createvm.py b/virtManager/createvm.py
index be947435..52bb6b2c 100644
--- a/virtManager/createvm.py
+++ b/virtManager/createvm.py
@@ -106,7 +106,6 @@ class _GuestData:
self.os_variant = None
self.uefi_requested = None
self.name = None
- self.firmware = None
self.vcpus = None
self.memory = None
@@ -161,8 +160,6 @@ class _GuestData:
guest.currentMemory = self.currentMemory
if self.memory:
guest.memory = self.memory
- if self.firmware == "uefi":
- guest.os.firmware = "efi"
return guest
@@ -481,7 +478,11 @@ class vmmCreateVM(vmmGObjectUI):
guest.os.is_ppc64() or
guest.os.is_s390x())
- if guest.prefers_uefi():
+ default_efi = self.config.get_default_firmware_setting() == "uefi"
+ if default_efi:
+ log.debug("UEFI default requested via app preferences")
+
+ if guest.prefers_uefi() or default_efi:
try:
# We call this for validation
guest.enable_uefi()
@@ -1428,7 +1429,6 @@ class vmmCreateVM(vmmGObjectUI):
gdata.default_graphics_type = self.config.get_graphics_type()
gdata.x86_cpu_default = self.config.get_default_cpu_setting()
- gdata.firmware = self.config.get_default_firmware_setting()
return gdata