Skip to content

Commit f5729aa

Browse files
authored
VMTests: Fix legacy boot tests. (#346)
In newer versions of libvirt, specifying the `nvram` element in the domain XML will result in the VM being interpreted as UEFI firmware based. Whereas in older versions of libvirt, the `nvram` element is ignored if the other UEFI elements (e.g. `loader`) are not specified. This change drops the `nvram` element when legacy boot is specified. This fixes the `libvirt: Domain Config error : no loader path specified and firmware auto selection disabled` error.
1 parent c562285 commit f5729aa

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

test/vmtests/vmtests/utils/libvirt_utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,8 @@ def create_libvirt_domain_xml(libvirt_conn: libvirt.virConnect, vm_spec: VmSpec)
160160
os_type.attrib["arch"] = host_arch
161161
os_type.attrib["machine"] = machine_model
162162

163-
ET.SubElement(os_tag, "nvram")
163+
if vm_spec.boot_type == "efi":
164+
ET.SubElement(os_tag, "nvram")
164165

165166
os_boot = ET.SubElement(os_tag, "boot")
166167

0 commit comments

Comments
 (0)