mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-01-08 21:18:04 +03:00
domain.features: use domcapabilities when setting default Hyper-V features
We will no longer enable hyperv features based on libvirt and QEMU versions. Some tests don't use the kvm-x86_64-domcaps-latest so the code will now not enable Hyper-V features. There are still other test cases that cover Hyper-V features so instead of mangling with URI for these tests update test data. Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
parent
66bbfa23b2
commit
9e9dbf735c
@ -15,11 +15,6 @@
|
||||
</os>
|
||||
<features>
|
||||
<pae/>
|
||||
<hyperv>
|
||||
<relaxed state="on"/>
|
||||
<vapic state="on"/>
|
||||
<spinlocks state="on" retries="8191"/>
|
||||
</hyperv>
|
||||
</features>
|
||||
<clock offset="localtime"/>
|
||||
<pm>
|
||||
@ -63,11 +58,6 @@
|
||||
</os>
|
||||
<features>
|
||||
<pae/>
|
||||
<hyperv>
|
||||
<relaxed state="on"/>
|
||||
<vapic state="on"/>
|
||||
<spinlocks state="on" retries="8191"/>
|
||||
</hyperv>
|
||||
</features>
|
||||
<clock offset="localtime"/>
|
||||
<pm>
|
||||
|
@ -15,11 +15,6 @@
|
||||
</os>
|
||||
<features>
|
||||
<pae/>
|
||||
<hyperv>
|
||||
<relaxed state="on"/>
|
||||
<vapic state="on"/>
|
||||
<spinlocks state="on" retries="8191"/>
|
||||
</hyperv>
|
||||
</features>
|
||||
<clock offset="localtime"/>
|
||||
<pm>
|
||||
@ -73,11 +68,6 @@
|
||||
</os>
|
||||
<features>
|
||||
<pae/>
|
||||
<hyperv>
|
||||
<relaxed state="on"/>
|
||||
<vapic state="on"/>
|
||||
<spinlocks state="on" retries="8191"/>
|
||||
</hyperv>
|
||||
</features>
|
||||
<clock offset="localtime"/>
|
||||
<pm>
|
||||
|
@ -16,11 +16,6 @@
|
||||
</os>
|
||||
<features>
|
||||
<pae/>
|
||||
<hyperv>
|
||||
<relaxed state="on"/>
|
||||
<vapic state="on"/>
|
||||
<spinlocks state="on" retries="8191"/>
|
||||
</hyperv>
|
||||
</features>
|
||||
<cpu>
|
||||
<topology sockets="1" dies="1" cores="4" threads="1"/>
|
||||
@ -67,11 +62,6 @@
|
||||
</os>
|
||||
<features>
|
||||
<pae/>
|
||||
<hyperv>
|
||||
<relaxed state="on"/>
|
||||
<vapic state="on"/>
|
||||
<spinlocks state="on" retries="8191"/>
|
||||
</hyperv>
|
||||
</features>
|
||||
<cpu>
|
||||
<topology sockets="1" dies="1" cores="4" threads="1"/>
|
||||
|
@ -63,17 +63,24 @@ class DomainFeatures(XMLBuilder):
|
||||
if not guest.hyperv_supported():
|
||||
return
|
||||
|
||||
if not self.conn.support.conn_hyperv_vapic():
|
||||
return
|
||||
features = guest.lookup_domcaps().supported_hyperv_features()
|
||||
|
||||
if self.hyperv_relaxed is None:
|
||||
self.hyperv_relaxed = True
|
||||
if self.hyperv_vapic is None:
|
||||
self.hyperv_vapic = True
|
||||
if self.hyperv_spinlocks is None:
|
||||
self.hyperv_spinlocks = True
|
||||
if self.hyperv_spinlocks_retries is None:
|
||||
self.hyperv_spinlocks_retries = 8191
|
||||
def _enable(name, requires=None, feature=None, value=True):
|
||||
feature = feature or name
|
||||
if feature not in features:
|
||||
return
|
||||
if getattr(self, f"hyperv_{name}") is not None:
|
||||
return
|
||||
if requires:
|
||||
for val in requires:
|
||||
if getattr(self, f"hyperv_{val}") is not True:
|
||||
return
|
||||
setattr(self, f"hyperv_{name}", value)
|
||||
|
||||
_enable("relaxed")
|
||||
_enable("vapic")
|
||||
_enable("spinlocks")
|
||||
_enable("spinlocks_retries", feature="spinlocks", value=8191)
|
||||
|
||||
def set_defaults(self, guest):
|
||||
if guest.os.is_container():
|
||||
|
Loading…
Reference in New Issue
Block a user