guest: Remove the hyperv + uefi workaround for win7 + win2k8r2

Both these windows versions are now longer supported, and UEFI isn't
the default, so I don't think this hack is much needed anymore

Signed-off-by: Cole Robinson <crobinso@redhat.com>
This commit is contained in:
Cole Robinson 2022-01-25 10:19:40 -05:00
parent 8896944d59
commit f13c8d87fb
9 changed files with 24 additions and 86 deletions

View File

@ -19,6 +19,11 @@
<features>
<acpi/>
<apic/>
<hyperv>
<relaxed state="on"/>
<vapic state="on"/>
<spinlocks state="on" retries="8191"/>
</hyperv>
<vmport state="off"/>
</features>
<cpu mode="host-model"/>
@ -26,6 +31,7 @@
<timer name="rtc" tickpolicy="catchup"/>
<timer name="pit" tickpolicy="delay"/>
<timer name="hpet" present="no"/>
<timer name="hypervclock" present="yes"/>
</clock>
<on_reboot>destroy</on_reboot>
<pm>
@ -96,6 +102,11 @@
<features>
<acpi/>
<apic/>
<hyperv>
<relaxed state="on"/>
<vapic state="on"/>
<spinlocks state="on" retries="8191"/>
</hyperv>
<vmport state="off"/>
</features>
<cpu mode="host-model"/>
@ -103,6 +114,7 @@
<timer name="rtc" tickpolicy="catchup"/>
<timer name="pit" tickpolicy="delay"/>
<timer name="hpet" present="no"/>
<timer name="hypervclock" present="yes"/>
</clock>
<pm>
<suspend-to-mem enabled="no"/>

View File

@ -0,0 +1,11 @@
</sysinfo>
<os>
<type arch="i686">hvm</type>
- <loader readonly="yes" type="pflash">/usr/share/edk2/ovmf/OVMF_CODE.fd</loader>
+ <loader readonly="yes" type="pflash">/usr/share/edk2/ovmf-ia32/OVMF_CODE.fd</loader>
<nvram>/nvram/test-many-devices_VARS.fd</nvram>
<smbios mode="sysinfo"/>
</os>
Domain 'test-many-devices' defined successfully.
Changes will take effect after the domain is fully powered off.

View File

@ -1,20 +0,0 @@
<os>
<type arch="i686">hvm</type>
<boot dev="hd"/>
+ <loader readonly="yes" type="pflash">/usr/share/edk2/ovmf-ia32/OVMF_CODE.fd</loader>
</os>
<features>
<acpi/>
<apic/>
- <hyperv mode="custom">
- <relaxed state="on"/>
- <vapic state="on"/>
- <spinlocks state="on" retries="8191"/>
- </hyperv>
+ <hyperv mode="custom"/>
<vmport state="off"/>
</features>
<clock offset="localtime">
Domain 'test-hyperv-uefi' defined successfully.
Changes will take effect after the domain is fully powered off.

View File

@ -914,46 +914,6 @@ test-many-devices, like an alternate RNG, EOL OS ID, title field
</domain>
<domain type='test'>
<name>test-hyperv-uefi</name>
<uuid>4a64cc71-19c4-2fd0-2323-f050941ea3c3</uuid>
<description>Used for testing specific win7 hyperv+uefi incompatibility via virt-xml</description>
<metadata>
<libosinfo:libosinfo xmlns:libosinfo="http://libosinfo.org/xmlns/libvirt/domain/1.0">
<libosinfo:os id="http://microsoft.com/win/7"/>
</libosinfo:libosinfo>
</metadata>
<memory>8388608</memory>
<currentMemory>2097152</currentMemory>
<vcpu>2</vcpu>
<os>
<type arch='i686'>hvm</type>
<boot dev='hd'/>
</os>
<features>
<acpi/>
<apic/>
<hyperv>
<relaxed state="on"/>
<vapic state="on"/>
<spinlocks state="on" retries="8191"/>
</hyperv>
<vmport state="off"/>
</features>
<clock offset="localtime">
<timer name="rtc" tickpolicy="catchup"/>
<timer name="pit" tickpolicy="delay"/>
<timer name="hpet" present="no"/>
<timer name="hypervclock" present="yes"/>
</clock>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash>
<devices>
</devices>
</domain>
<domain type='test' xmlns:test='http://libvirt.org/schemas/domain/test/1.0'>
<name>test-state-shutoff</name>
<memory>1048576</memory>

View File

@ -1265,7 +1265,7 @@ c.add_compare("4a64cc71-19c4-2fd0-2323-3050941ea3c3 --edit --boot network,cdrom"
c.add_compare("--confirm 1 --edit --cpu host-passthrough", "prompt-response", input_text="yes") # prompt response, also using domid lookup
c.add_compare("--edit --print-diff --qemu-commandline clearxml=yes", "edit-clearxml-qemu-commandline", input_file=(_VIRTXMLDIR + "virtxml-qemu-commandline-clear.xml"))
c.add_compare("--print-diff --remove-device --serial 1", "remove-console-dup", input_file=(_VIRTXMLDIR + "virtxml-console-dup.xml"))
c.add_compare("--print-diff --define --connect %(URI-KVM-X86)s test-hyperv-uefi --edit --boot uefi", "hyperv-uefi-collision")
c.add_compare("--print-diff --define --connect %(URI-KVM-X86)s test-many-devices --edit --boot uefi", "edit-boot-uefi")
c.add_compare("--print-diff --define --connect %(URI-KVM-X86)s test-many-devices --edit --cpu host-copy", "edit-cpu-host-copy")
c.add_compare("--connect %(URI-KVM-X86)s test-many-devices --build-xml --disk source.pool=pool-disk,source.volume=sdfg1", "build-disk-pool-disk")
c.add_compare("test --add-device --network default --update --confirm", "update-succeed", env={"VIRTXML_TESTSUITE_UPDATE_IGNORE_FAIL": "1", "VIRTINST_TEST_SUITE_INCREMENT_MACADDR": "1"}, input_text="yes\nyes\n") # test hotplug success

View File

@ -680,7 +680,6 @@ class vmmDomain(vmmLibvirtObject):
else:
# Implies UEFI
guest.set_uefi_path(loader)
guest.disable_hyperv_for_uefi()
if nvram != _SENTINEL:
guest.os.nvram = nvram

View File

@ -2734,7 +2734,6 @@ class ParserBoot(VirtCLIParser):
self.guest.uefi_requested = True
else:
self.guest.set_uefi_path(self.guest.get_uefi_path())
self.guest.disable_hyperv_for_uefi()
def set_initargs_cb(self, inst, val, virtarg):
inst.set_initargs_string(val)

View File

@ -570,20 +570,6 @@ class Guest(XMLBuilder):
self.os.machine)
self.os.machine = "q35"
def disable_hyperv_for_uefi(self):
# UEFI doesn't work with hyperv bits for some OS
if not self.is_uefi():
return # pragma: no cover
if not self.osinfo.broken_uefi_with_hyperv():
return # pragma: no cover
self.features.hyperv_relaxed = None
self.features.hyperv_vapic = None
self.features.hyperv_spinlocks = None
self.features.hyperv_spinlocks_retries = None
for i in self.clock.timers:
if i.name == "hypervclock":
self.clock.timers.remove(i)
def has_spice(self):
for gfx in self.devices.graphics:
if gfx.type == gfx.TYPE_SPICE:
@ -620,9 +606,6 @@ class Guest(XMLBuilder):
def hyperv_supported(self):
if not self.osinfo.is_windows():
return False
if (self.is_uefi() and
self.osinfo.broken_uefi_with_hyperv()):
return False
return True
def lookup_domcaps(self):

View File

@ -429,12 +429,6 @@ class _OsVariant(object):
def is_windows(self):
return self._family in ['win9x', 'winnt', 'win16']
def broken_uefi_with_hyperv(self):
# Some windows versions are broken with hyperv enlightenments + UEFI
# https://bugzilla.redhat.com/show_bug.cgi?id=1185253
# https://bugs.launchpad.net/qemu/+bug/1593605
return self.name in ("win2k8r2", "win7")
def get_clock(self):
if self.is_windows() or self._family in ['solaris']:
return "localtime"