[libvirt] [PATCH 4/6] Allow a timezone to be specified instead of sync to host timezone

Daniel P. Berrange berrange at redhat.com
Mon Mar 1 18:45:28 UTC 2010


On Mon, Mar 01, 2010 at 03:14:48PM +0100, Daniel Veillard wrote:
> On Thu, Feb 18, 2010 at 05:54:30PM +0000, Daniel P. Berrange wrote:
> > This extends the XML to allow for
> > 
> >   <clock offset='timezone' timezone='Europe/Paris'/>
> > 
> > This is useful if the admin has not configured any timezone on the
> > host OS, but still wants to synchronize a guest to a specific one.
> > 
> > * src/conf/domain_conf.h, src/conf/domain_conf.c: Support extra
> >   'timezone' attribute on clock configuration
> > * docs/schemas/domain.rng: Add 'timezone' attribute
> > * src/xen/xend_internal.c, src/xen/xm_internal.c: Reject configs
> >   with a configurable timezone
> > ---
> >  docs/schemas/domain.rng |   18 +++++++++++++++---
> >  src/conf/domain_conf.c  |   24 ++++++++++++++++++++----
> >  src/conf/domain_conf.h  |   13 ++++++++++---
> >  src/qemu/qemu_conf.c    |    2 +-
> >  src/xen/xend_internal.c |   10 ++++++++--
> >  src/xen/xm_internal.c   |   17 ++++++++++++-----
> >  6 files changed, 66 insertions(+), 18 deletions(-)
> > 
> > diff --git a/docs/schemas/domain.rng b/docs/schemas/domain.rng
> > index d295bfe..4a36a97 100644
> > --- a/docs/schemas/domain.rng
> > +++ b/docs/schemas/domain.rng
> > @@ -298,9 +298,16 @@
> >      <optional>
> >        <element name="clock">
> >  	<choice>
> > -          <attribute name="offset">
> > -            <value>localtime</value>
> > -	  </attribute>
> > +	  <group>
> > +            <attribute name="offset">
> > +              <value>localtime</value>
> > +	    </attribute>
> > +	    <optional>
> > +	      <attribute name="timezone">
> > +		<ref name="timeZone"/>
> > +	      </attribute>
> > +	    </optional>
> > +	  </group>
> >            <attribute name="offset">
> >              <value>utc</value>
> >  	  </attribute>
> > @@ -1584,4 +1591,9 @@
> >        <param name="pattern">(-|\+)?[0-9]+</param>
> >      </data>
> >    </define>
> > +  <define name="timeZone">
> > +    <data type="string">
> > +      <param name="pattern">[a-zA-Z0-9_\.\+\-/]+</param>
> 
>   Hum ... I wonder if we should not add ':' as it's used for POSIX TZ

How is it used ?  I looked at /usr/share/zoneinfo and all the files
there should be matched by this regex ok without needing ':'

Daniel
-- 
|: Red Hat, Engineering, London    -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org -o- http://virt-manager.org -o- http://deltacloud.org :|
|: http://autobuild.org        -o-         http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-   F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|




More information about the libvir-list mailing list