Add hpet option for time drifting

Since havana, the timezone of windows vm is localtime.
However, there is a time drifting when the windows vm is overloaded.
Disabling hpet option of clock in xml template,
we can sync time without buffering.

From this template,

<clock offset='utc'>
<timer name='pit' tickpolicy='delay'/>
<timer name='rtc' tickpolicy='catchup'/>
</clock>

To this template,

<clock offset='localtime'>
<timer name='rtc' tickpolicy='catchup'/>
<timer name='pit' tickpolicy='delay'/>
<timer name='hpet' present='no'/>
</clock>

Implements : blueprint add-no-hpet-option-into-guest-clock
Change-Id: I6441b9d2de5897dd1863b53bd7e2578881b53c67
This commit is contained in:
yongiman 2013-12-23 22:43:59 +09:00
parent a1f6e85277
commit ba3fd16605
2 changed files with 10 additions and 1 deletions

View File

@ -804,17 +804,21 @@ class LibvirtConnTestCase(test.TestCase):
self.assertEqual(type(cfg.clock),
vconfig.LibvirtConfigGuestClock)
self.assertEqual(cfg.clock.offset, "utc")
self.assertEqual(len(cfg.clock.timers), 2)
self.assertEqual(len(cfg.clock.timers), 3)
self.assertEqual(type(cfg.clock.timers[0]),
vconfig.LibvirtConfigGuestTimer)
self.assertEqual(type(cfg.clock.timers[1]),
vconfig.LibvirtConfigGuestTimer)
self.assertEqual(type(cfg.clock.timers[2]),
vconfig.LibvirtConfigGuestTimer)
self.assertEqual(cfg.clock.timers[0].name, "pit")
self.assertEqual(cfg.clock.timers[0].tickpolicy,
"delay")
self.assertEqual(cfg.clock.timers[1].name, "rtc")
self.assertEqual(cfg.clock.timers[1].tickpolicy,
"catchup")
self.assertEqual(cfg.clock.timers[2].name, "hpet")
self.assertEqual(cfg.clock.timers[2].present, False)
def test_get_guest_config_windows(self):
conn = libvirt_driver.LibvirtDriver(fake.FakeVirtAPI(), True)

View File

@ -3120,8 +3120,13 @@ class LibvirtDriver(driver.ComputeDriver):
tmrtc.name = "rtc"
tmrtc.tickpolicy = "catchup"
tmhpet = vconfig.LibvirtConfigGuestTimer()
tmhpet.name = "hpet"
tmhpet.present = False
clk.add_timer(tmpit)
clk.add_timer(tmrtc)
clk.add_timer(tmhpet)
for cfg in self.get_guest_storage_config(instance,
image_meta,