mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-02-02 09:47:16 +03:00
support: enable hv_time since qemu-kvm 1.5.3 from RHEL
This feature is available in upstream Qemu since 2.0.0 but it was also back-ported to downstream Qemu into qemu-kvm-1.5.3 released in RHEL-7. Add a new check and enable hv_time also in RHEL systems if qemu new enough. Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
parent
1590490fa3
commit
2d9587c114
66
tests/xmlconfig-xml/install-hyperv-clock.xml
Normal file
66
tests/xmlconfig-xml/install-hyperv-clock.xml
Normal file
@ -0,0 +1,66 @@
|
||||
<domain type="kvm">
|
||||
<name>TestGuest</name>
|
||||
<uuid>12345678-1234-1234-1234-123456789012</uuid>
|
||||
<memory>409600</memory>
|
||||
<currentMemory>204800</currentMemory>
|
||||
<vcpu>5</vcpu>
|
||||
<os>
|
||||
<type arch="i686">hvm</type>
|
||||
<boot dev="cdrom"/>
|
||||
<boot dev="hd"/>
|
||||
</os>
|
||||
<features>
|
||||
<acpi/>
|
||||
<apic/>
|
||||
<hyperv>
|
||||
<relaxed state="on"/>
|
||||
<vapic state="on"/>
|
||||
<spinlocks state="on" retries="8191"/>
|
||||
</hyperv>
|
||||
</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>destroy</on_reboot>
|
||||
<on_crash>destroy</on_crash>
|
||||
<pm>
|
||||
<suspend-to-mem enabled="no"/>
|
||||
<suspend-to-disk enabled="no"/>
|
||||
</pm>
|
||||
<devices>
|
||||
<emulator>/usr/libexec/qemu-kvm</emulator>
|
||||
<disk type="file" device="floppy">
|
||||
<driver name="qemu" type="qcow2"/>
|
||||
<source file="/dev/default-pool/testvol1.img"/>
|
||||
<target dev="fda" bus="fdc"/>
|
||||
</disk>
|
||||
<disk type="file" device="disk">
|
||||
<driver name="qemu" type="raw"/>
|
||||
<source file="/dev/default-pool/new-test-suite.img"/>
|
||||
<target dev="hda" bus="ide"/>
|
||||
</disk>
|
||||
<disk type="block" device="disk">
|
||||
<driver name="qemu" type="raw" cache="none" io="native"/>
|
||||
<source dev="/dev/disk-pool/diskvol1"/>
|
||||
<target dev="hdb" bus="ide"/>
|
||||
</disk>
|
||||
<disk type="file" device="cdrom">
|
||||
<driver name="qemu"/>
|
||||
<source file="/dev/null"/>
|
||||
<target dev="hdc" bus="ide"/>
|
||||
<readonly/>
|
||||
</disk>
|
||||
<interface type="network">
|
||||
<source network="default"/>
|
||||
<mac address="22:22:33:44:55:66"/>
|
||||
</interface>
|
||||
<input type="tablet" bus="usb"/>
|
||||
<graphics type="vnc" port="-1" keymap="ja"/>
|
||||
<console type="pty"/>
|
||||
<sound model="ich6"/>
|
||||
</devices>
|
||||
</domain>
|
65
tests/xmlconfig-xml/install-hyperv-noclock.xml
Normal file
65
tests/xmlconfig-xml/install-hyperv-noclock.xml
Normal file
@ -0,0 +1,65 @@
|
||||
<domain type="kvm">
|
||||
<name>TestGuest</name>
|
||||
<uuid>12345678-1234-1234-1234-123456789012</uuid>
|
||||
<memory>409600</memory>
|
||||
<currentMemory>204800</currentMemory>
|
||||
<vcpu>5</vcpu>
|
||||
<os>
|
||||
<type arch="i686">hvm</type>
|
||||
<boot dev="cdrom"/>
|
||||
<boot dev="hd"/>
|
||||
</os>
|
||||
<features>
|
||||
<acpi/>
|
||||
<apic/>
|
||||
<hyperv>
|
||||
<relaxed state="on"/>
|
||||
<vapic state="on"/>
|
||||
<spinlocks state="on" retries="8191"/>
|
||||
</hyperv>
|
||||
</features>
|
||||
<clock offset="localtime">
|
||||
<timer name="rtc" tickpolicy="catchup"/>
|
||||
<timer name="pit" tickpolicy="delay"/>
|
||||
<timer name="hpet" present="no"/>
|
||||
</clock>
|
||||
<on_poweroff>destroy</on_poweroff>
|
||||
<on_reboot>destroy</on_reboot>
|
||||
<on_crash>destroy</on_crash>
|
||||
<pm>
|
||||
<suspend-to-mem enabled="no"/>
|
||||
<suspend-to-disk enabled="no"/>
|
||||
</pm>
|
||||
<devices>
|
||||
<emulator>/usr/libexec/qemu-kvm</emulator>
|
||||
<disk type="file" device="floppy">
|
||||
<driver name="qemu" type="qcow2"/>
|
||||
<source file="/dev/default-pool/testvol1.img"/>
|
||||
<target dev="fda" bus="fdc"/>
|
||||
</disk>
|
||||
<disk type="file" device="disk">
|
||||
<driver name="qemu" type="raw"/>
|
||||
<source file="/dev/default-pool/new-test-suite.img"/>
|
||||
<target dev="hda" bus="ide"/>
|
||||
</disk>
|
||||
<disk type="block" device="disk">
|
||||
<driver name="qemu" type="raw" cache="none" io="native"/>
|
||||
<source dev="/dev/disk-pool/diskvol1"/>
|
||||
<target dev="hdb" bus="ide"/>
|
||||
</disk>
|
||||
<disk type="file" device="cdrom">
|
||||
<driver name="qemu"/>
|
||||
<source file="/dev/null"/>
|
||||
<target dev="hdc" bus="ide"/>
|
||||
<readonly/>
|
||||
</disk>
|
||||
<interface type="network">
|
||||
<source network="default"/>
|
||||
<mac address="22:22:33:44:55:66"/>
|
||||
</interface>
|
||||
<input type="tablet" bus="usb"/>
|
||||
<graphics type="vnc" port="-1" keymap="ja"/>
|
||||
<console type="pty"/>
|
||||
<sound model="ich6"/>
|
||||
</devices>
|
||||
</domain>
|
@ -326,3 +326,28 @@ class TestXMLMisc(unittest.TestCase):
|
||||
self._compare(g, "install-novmvga-rhel", True)
|
||||
finally:
|
||||
CLIConfig.stable_defaults = False
|
||||
|
||||
def test_hyperv_clock(self):
|
||||
def _make(connver):
|
||||
conn = utils.open_kvm(libver=1002002, connver=connver)
|
||||
g = _make_guest(conn=conn)
|
||||
g.os_variant = "win7"
|
||||
g.emulator = "/usr/libexec/qemu-kvm"
|
||||
return g
|
||||
|
||||
try:
|
||||
g = _make(2000000)
|
||||
self._compare(g, "install-hyperv-clock", True)
|
||||
|
||||
g = _make(1009000)
|
||||
self._compare(g, "install-hyperv-noclock", True)
|
||||
|
||||
CLIConfig.stable_defaults = True
|
||||
|
||||
g = _make(1005003)
|
||||
self._compare(g, "install-hyperv-clock", True)
|
||||
|
||||
g = _make(1005002)
|
||||
self._compare(g, "install-hyperv-noclock", True)
|
||||
finally:
|
||||
CLIConfig.stable_defaults = False
|
||||
|
@ -764,9 +764,11 @@ class Guest(XMLBuilder):
|
||||
hpet.name = "hpet"
|
||||
hpet.present = False
|
||||
|
||||
if (self._os_object.is_windows() and
|
||||
self.conn.check_support(self.conn.SUPPORT_CONN_HYPERV_CLOCK) and
|
||||
self._hv_supported()):
|
||||
hv_clock = self.conn.check_support(self.conn.SUPPORT_CONN_HYPERV_CLOCK)
|
||||
hv_clock_rhel = self.conn.check_support(self.conn.SUPPORT_CONN_HYPERV_CLOCK_RHEL)
|
||||
|
||||
if (self._os_object.is_windows() and self._hv_supported() and
|
||||
(hv_clock or (self.stable_defaults() and hv_clock_rhel))):
|
||||
hyperv = self.clock.add_timer()
|
||||
hyperv.name = "hypervclock"
|
||||
hyperv.present = True
|
||||
|
@ -298,6 +298,8 @@ SUPPORT_CONN_HYPERV_VAPIC = _make(
|
||||
version="1.1.0", hv_version={"qemu": "1.1.0", "test": 0})
|
||||
SUPPORT_CONN_HYPERV_CLOCK = _make(
|
||||
version="1.2.2", hv_version={"qemu": "2.0.0", "test": 0})
|
||||
SUPPORT_CONN_HYPERV_CLOCK_RHEL = _make(
|
||||
version="1.2.2", hv_version={"qemu": "1.5.3", "test": 0})
|
||||
SUPPORT_CONN_LOADER_ROM = _make(version="1.2.9")
|
||||
SUPPORT_CONN_DOMAIN_CAPABILITIES = _make(
|
||||
function="virConnect.getDomainCapabilities",
|
||||
|
Loading…
x
Reference in New Issue
Block a user