Hello Vinzenz Feenstra, Dan Kenigsberg, Michal Skrivanek,
I'd like you to do a code review. Please visit
http://gerrit.ovirt.org/30255
to review the following change.
Change subject: vm: hyperv: make hw clock friendlier to windows
......................................................................
vm: hyperv: make hw clock friendlier to windows
This patch sets the local time as windows reportedly
expect. According to libvirt docs:
" Most operating systems expect the hardware clock to
be kept in UTC, and this is the default.
Windows, however, expects it to be in so called 'localtime'."
http://libvirt.org/formatdomain.html#elementsTime
This is the reccommended setting for windows and reportedly
has stability benefits for live migrations.
The new setting is enabled on top of the hyperv optimizations,
and is disabled by default for backward compatibility.
Change-Id: I84a8cfded683a42826b6dabb67b4a5eb456594d7
Bug-Url: https://bugzilla.redhat.com/1107835
Signed-off-by: Francesco Romani <[email protected]>
Reviewed-on: http://gerrit.ovirt.org/29233
Reviewed-by: Michal Skrivanek <[email protected]>
Reviewed-by: Vinzenz Feenstra <[email protected]>
Reviewed-by: Dan Kenigsberg <[email protected]>
---
M tests/vmTests.py
M vdsm/virt/vm.py
2 files changed, 17 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/55/30255/1
diff --git a/tests/vmTests.py b/tests/vmTests.py
index f435ada..7ee2eb8 100644
--- a/tests/vmTests.py
+++ b/tests/vmTests.py
@@ -379,6 +379,20 @@
domxml.appendClock()
self.assertXML(domxml.dom, clockXML, 'clock')
+ def testHyperVClockXML(self):
+ clockXML = """
+ <clock adjustment="-3600" offset="variable">
+ <timer name="rtc" tickpolicy="catchup" track="guest"/>
+ <timer name="pit" tickpolicy="delay"/>
+ <timer name="hpet" present="no"/>
+ </clock>"""
+ conf = {'timeOffset': '-3600', 'hypervEnable': 'true'}
+ conf.update(self.conf)
+ domxml = vm._DomXML(conf, self.log,
+ caps.Architecture.X86_64)
+ domxml.appendClock()
+ self.assertXML(domxml.dom, clockXML, 'clock')
+
def testCpuXML(self):
cpuXML = """
<cpu match="exact">
diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py
index 42f63f5..30a5679 100644
--- a/vdsm/virt/vm.py
+++ b/vdsm/virt/vm.py
@@ -739,7 +739,9 @@
m = XMLElement('clock', offset='variable',
adjustment=str(self.conf.get('timeOffset', 0)))
- m.appendChildWithArgs('timer', name='rtc', tickpolicy='catchup')
+ rtc = m.appendChildWithArgs('timer', name='rtc', tickpolicy='catchup')
+ if utils.tobool(self.conf.get('hypervEnable', 'false')):
+ rtc.setAttrs(track='guest')
m.appendChildWithArgs('timer', name='pit', tickpolicy='delay')
if self.arch == caps.Architecture.X86_64:
--
To view, visit http://gerrit.ovirt.org/30255
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I84a8cfded683a42826b6dabb67b4a5eb456594d7
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.5
Gerrit-Owner: Francesco Romani <[email protected]>
Gerrit-Reviewer: Dan Kenigsberg <[email protected]>
Gerrit-Reviewer: Michal Skrivanek <[email protected]>
Gerrit-Reviewer: Vinzenz Feenstra <[email protected]>
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches