Add new clock mode allowing variable adjustments

This introduces a third option for clock offset synchronization,
that allows an arbitrary / variable adjustment to be set. In
essence the XML contains the time delta in seconds, relative to
UTC.

  <clock offset='variable' adjustment='123465'/>

The difference from 'utc' mode, is that management apps should
track adjustments and preserve them at next reboot.

* docs/schemas/domain.rng: Schema for new clock mode
* src/conf/domain_conf.c, src/conf/domain_conf.h: Parse
  new clock time delta
* src/libvirt_private.syms, src/util/xml.c, src/util/xml.h: Add
  virXPathLongLong() method
This commit is contained in:
Daniel P. Berrange
2010-02-02 17:49:09 +00:00
parent eed2f8c3a9
commit b9e2967a5e
6 changed files with 101 additions and 7 deletions

View File

@@ -297,12 +297,24 @@
<define name="clock">
<optional>
<element name="clock">
<attribute name="offset">
<choice>
<choice>
<attribute name="offset">
<value>localtime</value>
</attribute>
<attribute name="offset">
<value>utc</value>
</choice>
</attribute>
</attribute>
<group>
<attribute name="offset">
<value>variable</value>
</attribute>
<optional>
<attribute name="adjustment">
<ref name="timeDelta"/>
</attribute>
</optional>
</group>
</choice>
<empty/>
</element>
</optional>
@@ -1616,4 +1628,9 @@
<param name='pattern'>[a-zA-Z0-9\-_]+</param>
</data>
</define>
<define name="timeDelta">
<data type="string">
<param name="pattern">(-|\+)?[0-9]+</param>
</data>
</define>
</grammar>