mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-03-14 00:58:28 +03:00
capabilities: detect ACPI and APIC capabilites properly
Instead of hard-coding that ACPI and APIC are enabled by default, detect their presence from libvirt capabilities and use it. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1215692 (crobinso: Adjust for recently added test case) Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
parent
3ff35898a4
commit
1590490fa3
@ -11,10 +11,6 @@
|
||||
<boot dev="cdrom"/>
|
||||
<boot dev="hd"/>
|
||||
</os>
|
||||
<features>
|
||||
<acpi/>
|
||||
<apic/>
|
||||
</features>
|
||||
<clock offset="utc"/>
|
||||
<on_poweroff>restart</on_poweroff>
|
||||
<on_reboot>destroy</on_reboot>
|
||||
@ -53,10 +49,6 @@
|
||||
<nvram template="VARS.fd"/>
|
||||
<boot dev="hd"/>
|
||||
</os>
|
||||
<features>
|
||||
<acpi/>
|
||||
<apic/>
|
||||
</features>
|
||||
<clock offset="utc"/>
|
||||
<on_poweroff>restart</on_poweroff>
|
||||
<on_reboot>destroy</on_reboot>
|
||||
|
@ -9,10 +9,6 @@
|
||||
<loader readonly="yes" type="pflash">/usr/share/AAVMF/AAVMF_CODE.fd</loader>
|
||||
<boot dev="hd"/>
|
||||
</os>
|
||||
<features>
|
||||
<acpi/>
|
||||
<apic/>
|
||||
</features>
|
||||
<cpu mode="host-passthrough"/>
|
||||
<clock offset="utc"/>
|
||||
<on_poweroff>destroy</on_poweroff>
|
||||
|
@ -10,10 +10,6 @@
|
||||
<initrd>/f19-arm.initrd</initrd>
|
||||
<cmdline>console=ttyAMA0,1234 rw root=/dev/vda3</cmdline>
|
||||
</os>
|
||||
<features>
|
||||
<acpi/>
|
||||
<apic/>
|
||||
</features>
|
||||
<cpu mode="custom" match="exact">
|
||||
<model>cortex-a57</model>
|
||||
</cpu>
|
||||
|
@ -10,10 +10,6 @@
|
||||
<initrd>/f19-arm.initrd</initrd>
|
||||
<cmdline>console=ttyAMA0,1234 rw root=/dev/vda3</cmdline>
|
||||
</os>
|
||||
<features>
|
||||
<acpi/>
|
||||
<apic/>
|
||||
</features>
|
||||
<cpu mode="custom" match="exact">
|
||||
<model>cortex-a57</model>
|
||||
</cpu>
|
||||
|
@ -10,10 +10,6 @@
|
||||
<initrd>/f19-arm.initrd</initrd>
|
||||
<cmdline>console=ttyAMA0,1234 rw root=/dev/vda3</cmdline>
|
||||
</os>
|
||||
<features>
|
||||
<acpi/>
|
||||
<apic/>
|
||||
</features>
|
||||
<clock offset="utc"/>
|
||||
<on_poweroff>destroy</on_poweroff>
|
||||
<on_reboot>restart</on_reboot>
|
||||
|
@ -8,10 +8,6 @@
|
||||
<type arch="armv7l" machine="virt">hvm</type>
|
||||
<boot dev="hd"/>
|
||||
</os>
|
||||
<features>
|
||||
<acpi/>
|
||||
<apic/>
|
||||
</features>
|
||||
<cpu mode="host-passthrough"/>
|
||||
<clock offset="utc"/>
|
||||
<on_poweroff>destroy</on_poweroff>
|
||||
|
@ -11,10 +11,6 @@
|
||||
<cmdline>console=ttyAMA0,1234 rw root=/dev/vda3</cmdline>
|
||||
<dtb>/f19-arm.dtb</dtb>
|
||||
</os>
|
||||
<features>
|
||||
<acpi/>
|
||||
<apic/>
|
||||
</features>
|
||||
<clock offset="utc"/>
|
||||
<on_poweroff>destroy</on_poweroff>
|
||||
<on_reboot>restart</on_reboot>
|
||||
|
@ -11,10 +11,6 @@
|
||||
<cmdline>console=ttyAMA0 rw root=/dev/mmcblk0p3</cmdline>
|
||||
<dtb>/f19-arm.dtb</dtb>
|
||||
</os>
|
||||
<features>
|
||||
<acpi/>
|
||||
<apic/>
|
||||
</features>
|
||||
<clock offset="utc"/>
|
||||
<on_poweroff>destroy</on_poweroff>
|
||||
<on_reboot>restart</on_reboot>
|
||||
|
@ -10,10 +10,6 @@
|
||||
<initrd>/f19-arm.initrd</initrd>
|
||||
<cmdline>console=ttyAMA0,1234 rw root=/dev/vda3</cmdline>
|
||||
</os>
|
||||
<features>
|
||||
<acpi/>
|
||||
<apic/>
|
||||
</features>
|
||||
<clock offset="utc"/>
|
||||
<on_poweroff>destroy</on_poweroff>
|
||||
<on_reboot>restart</on_reboot>
|
||||
|
@ -9,8 +9,6 @@
|
||||
<boot dev="network"/>
|
||||
</os>
|
||||
<features>
|
||||
<acpi/>
|
||||
<apic/>
|
||||
<pae/>
|
||||
</features>
|
||||
<clock offset="utc"/>
|
||||
@ -51,8 +49,6 @@
|
||||
<boot dev="network"/>
|
||||
</os>
|
||||
<features>
|
||||
<acpi/>
|
||||
<apic/>
|
||||
<pae/>
|
||||
</features>
|
||||
<clock offset="utc"/>
|
||||
|
@ -9,8 +9,6 @@
|
||||
<boot dev="network"/>
|
||||
</os>
|
||||
<features>
|
||||
<acpi/>
|
||||
<apic/>
|
||||
<vmport state="off"/>
|
||||
</features>
|
||||
<clock offset="utc"/>
|
||||
|
@ -9,8 +9,6 @@
|
||||
<boot dev="network"/>
|
||||
</os>
|
||||
<features>
|
||||
<acpi/>
|
||||
<apic/>
|
||||
<vmport state="off"/>
|
||||
</features>
|
||||
<clock offset="utc"/>
|
||||
|
@ -9,8 +9,6 @@
|
||||
<boot dev="hd"/>
|
||||
</os>
|
||||
<features>
|
||||
<acpi/>
|
||||
<apic/>
|
||||
<vmport state="off"/>
|
||||
</features>
|
||||
<clock offset="utc"/>
|
||||
|
@ -9,10 +9,6 @@
|
||||
<kernel>/kernel.img</kernel>
|
||||
<initrd>/initrd.img</initrd>
|
||||
</os>
|
||||
<features>
|
||||
<acpi/>
|
||||
<apic/>
|
||||
</features>
|
||||
<clock offset="utc"/>
|
||||
<on_poweroff>destroy</on_poweroff>
|
||||
<on_reboot>restart</on_reboot>
|
||||
|
@ -9,8 +9,6 @@
|
||||
<boot dev="network"/>
|
||||
</os>
|
||||
<features>
|
||||
<acpi/>
|
||||
<apic/>
|
||||
<pae/>
|
||||
</features>
|
||||
<clock offset="utc"/>
|
||||
@ -51,8 +49,6 @@
|
||||
<boot dev="network"/>
|
||||
</os>
|
||||
<features>
|
||||
<acpi/>
|
||||
<apic/>
|
||||
<pae/>
|
||||
</features>
|
||||
<clock offset="utc"/>
|
||||
|
@ -10,8 +10,6 @@
|
||||
<boot dev="hd"/>
|
||||
</os>
|
||||
<features>
|
||||
<acpi/>
|
||||
<apic/>
|
||||
<pae/>
|
||||
<hyperv>
|
||||
<relaxed state="on"/>
|
||||
@ -60,8 +58,6 @@
|
||||
<boot dev="hd"/>
|
||||
</os>
|
||||
<features>
|
||||
<acpi/>
|
||||
<apic/>
|
||||
<pae/>
|
||||
<hyperv>
|
||||
<relaxed state="on"/>
|
||||
@ -110,8 +106,6 @@
|
||||
<boot dev="hd"/>
|
||||
</os>
|
||||
<features>
|
||||
<acpi/>
|
||||
<apic/>
|
||||
<pae/>
|
||||
<hyperv>
|
||||
<relaxed state="on"/>
|
||||
|
@ -206,6 +206,8 @@ class _CapsGuestFeatures(XMLBuilder):
|
||||
_XML_ROOT_NAME = "features"
|
||||
|
||||
pae = XMLProperty("./pae", is_bool=True)
|
||||
acpi = XMLProperty("./acpi/@default", is_onoff=True)
|
||||
apic = XMLProperty("./apic/@default", is_onoff=True)
|
||||
|
||||
|
||||
class _CapsGuest(XMLBuilder):
|
||||
@ -293,6 +295,18 @@ class _CapsGuest(XMLBuilder):
|
||||
"""
|
||||
return bool(self.features.pae)
|
||||
|
||||
def supports_acpi(self):
|
||||
"""
|
||||
Return Tree if capabilities report support for ACPI
|
||||
"""
|
||||
return bool(self.features.acpi)
|
||||
|
||||
def supports_apic(self):
|
||||
"""
|
||||
Return Tree if capabilities report support for APIC
|
||||
"""
|
||||
return bool(self.features.apic)
|
||||
|
||||
|
||||
############################
|
||||
# Main capabilities object #
|
||||
|
@ -843,9 +843,12 @@ class Guest(XMLBuilder):
|
||||
default = False
|
||||
|
||||
if self.features.acpi == "default":
|
||||
self.features.acpi = self._os_object.supports_acpi(default)
|
||||
if default:
|
||||
self.features.acpi = self.capsinfo.guest.supports_acpi()
|
||||
else:
|
||||
self.features.acpi = False
|
||||
if self.features.apic == "default":
|
||||
self.features.apic = self._os_object.supports_apic(default)
|
||||
self.features.apic = self.capsinfo.guest.supports_apic()
|
||||
if self.features.pae == "default":
|
||||
self.features.pae = self.capsinfo.guest.supports_pae()
|
||||
|
||||
|
@ -447,14 +447,6 @@ class _OsVariant(object):
|
||||
def supports_virtiommio(self):
|
||||
return self._is_related_to(["fedora19"])
|
||||
|
||||
def supports_acpi(self, default):
|
||||
if self._family in ['msdos']:
|
||||
return False
|
||||
return default
|
||||
|
||||
def supports_apic(self, default):
|
||||
return self.supports_acpi(default)
|
||||
|
||||
def default_netmodel(self):
|
||||
"""
|
||||
Default non-virtio net-model, since we check for that separately
|
||||
|
Loading…
x
Reference in New Issue
Block a user