virt-manager/0c223ab2-guest-Dont-set-default-uefi-if-firmware-is-set.patch
Charles Arnold 7a4cac2ed8 - Upstream bug fixes (bsc#1027942)
0c223ab2-guest-Dont-set-default-uefi-if-firmware-is-set.patch
  414ffa5e-virt-install-Use-minutes-instead-of-seconds-on-get_time_string.patch
  53245827-urlfetcher-Force-a-flush-after-writing-to-a-file.patch
  3009888a-urlfetcher-Dont-override-fullurl-when-its-explicitly-set.patch

OBS-URL: https://build.opensuse.org/package/show/Virtualization/virt-manager?expand=0&rev=482
2019-08-27 20:01:01 +00:00

111 lines
4.2 KiB
Diff

Subject: guest: Don't set default uefi if firmware= is set
From: Cole Robinson crobinso@redhat.com Fri Jul 12 15:58:22 2019 -0400
Date: Fri Jul 12 16:01:21 2019 -0400:
Git: 0c223ab21f0cff216b4a1ab2070a43f0e943d308
diff --git a/tests/cli-test-xml/compare/virt-install-aarch64-firmware-no-override.xml b/tests/cli-test-xml/compare/virt-install-aarch64-firmware-no-override.xml
new file mode 100644
index 00000000..b062e805
--- /dev/null
+++ b/tests/cli-test-xml/compare/virt-install-aarch64-firmware-no-override.xml
@@ -0,0 +1,55 @@
+<domain type="kvm">
+ <name>vm1</name>
+ <uuid>00000000-1111-2222-3333-444444444444</uuid>
+ <memory>65536</memory>
+ <currentMemory>65536</currentMemory>
+ <vcpu>1</vcpu>
+ <os firmware="efi">
+ <type arch="aarch64" machine="virt">hvm</type>
+ <boot dev="network"/>
+ </os>
+ <cpu mode="host-passthrough"/>
+ <clock offset="utc"/>
+ <on_reboot>destroy</on_reboot>
+ <devices>
+ <emulator>/usr/bin/qemu-system-aarch64</emulator>
+ <controller type="usb" index="0" model="qemu-xhci" ports="15"/>
+ <interface type="bridge">
+ <source bridge="testsuitebr0"/>
+ <mac address="00:11:22:33:44:55"/>
+ <model type="virtio"/>
+ </interface>
+ <console type="pty"/>
+ <channel type="unix">
+ <source mode="bind"/>
+ <target type="virtio" name="org.qemu.guest_agent.0"/>
+ </channel>
+ </devices>
+</domain>
+<domain type="kvm">
+ <name>vm1</name>
+ <uuid>00000000-1111-2222-3333-444444444444</uuid>
+ <memory>65536</memory>
+ <currentMemory>65536</currentMemory>
+ <vcpu>1</vcpu>
+ <os firmware="efi">
+ <type arch="aarch64" machine="virt">hvm</type>
+ <boot dev="network"/>
+ </os>
+ <cpu mode="host-passthrough"/>
+ <clock offset="utc"/>
+ <devices>
+ <emulator>/usr/bin/qemu-system-aarch64</emulator>
+ <controller type="usb" index="0" model="qemu-xhci" ports="15"/>
+ <interface type="bridge">
+ <source bridge="testsuitebr0"/>
+ <mac address="00:11:22:33:44:55"/>
+ <model type="virtio"/>
+ </interface>
+ <console type="pty"/>
+ <channel type="unix">
+ <source mode="bind"/>
+ <target type="virtio" name="org.qemu.guest_agent.0"/>
+ </channel>
+ </devices>
+</domain>
diff --git a/tests/clitest.py b/tests/clitest.py
index 7ef324bc..a309f937 100644
--- a/tests/clitest.py
+++ b/tests/clitest.py
@@ -990,6 +990,7 @@ c.add_compare("--arch aarch64 --boot kernel=/f19-arm.kernel,initrd=/f19-arm.init
c.add_compare("--arch aarch64 --cdrom %(EXISTIMG2)s --boot loader=CODE.fd,nvram.template=VARS.fd --disk %(EXISTIMG1)s --cpu none --events on_crash=preserve,on_reboot=destroy,on_poweroff=restart", "aarch64-cdrom")
c.add_compare("--connect %(URI-KVM-AARCH64)s --disk %(EXISTIMG1)s --import --os-variant fedora21 --panic default", "aarch64-kvm-import") # the --panic is a no-op
c.add_compare("--connect %(URI-KVM-AARCH64)s --disk size=1 --os-variant fedora22 --features gic_version=host --network network=default,address.type=pci --controller type=scsi,model=virtio-scsi,address.type=pci", "aarch64-kvm-gic")
+c.add_compare("--connect %(URI-KVM-AARCH64)s --arch aarch64 --disk none --pxe --boot firmware=efi", "aarch64-firmware-no-override")
# Simple headless guests for various architectures
diff --git a/virtinst/guest.py b/virtinst/guest.py
index 41357644..f0fcfe7d 100644
--- a/virtinst/guest.py
+++ b/virtinst/guest.py
@@ -561,8 +561,9 @@ class Guest(XMLBuilder):
return path
def is_uefi(self):
- return bool(self.os.loader and
- self.os.loader_type == "pflash")
+ if self.os.loader and self.os.loader_type == "pflash":
+ return True
+ return self.os.firmware == "efi"
def set_uefi_path(self, path):
"""
@@ -781,11 +782,13 @@ class Guest(XMLBuilder):
not self.os.kernel and
not self.os.loader and
self.os.loader_ro is None and
- self.os.nvram is None)
+ self.os.nvram is None and
+ self.os.firmware is None)
if use_default_uefi or self.uefi_requested:
try:
path = self.get_uefi_path()
+ log.debug("Setting UEFI path=%s", path)
self.set_uefi_path(path)
except RuntimeError as e:
if self.uefi_requested: