[libvirt] [PATCHv3 1/3] Support clock=variable relative to localtime

Philipp Hahn hahn at univention.de
Tue Feb 14 18:11:20 UTC 2012


Hi,

forgot one line to commit

On Monday 06 February 2012 14:59:16 Philipp Hahn wrote:
> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
> index aa4b32d..5508fc9 100644
...
> @@ -7467,10 +7471,52 @@ static virDomainDefPtr
> virDomainDefParseXML(virCapsPtr caps, def->clock.offset =
> VIR_DOMAIN_CLOCK_OFFSET_UTC;
>      }
>      switch (def->clock.offset) {
> +    case VIR_DOMAIN_CLOCK_OFFSET_LOCALTIME:
> +    case VIR_DOMAIN_CLOCK_OFFSET_UTC:
> +        tmp = virXPathString("string(./clock/@adjustment)", ctxt);
> +        if (tmp) {
> +            if (STREQ(tmp, "reset")) {
> +                def->clock.data.utc_reset = true;
> +            } else {
> +                char *conv = NULL;
> +                unsigned long long val;
> +                val = strtoll(tmp, &conv, 10);
> +                if (conv == tmp || *conv != '\0') {
> +                    virDomainReportError(VIR_ERR_INTERNAL_ERROR,
> +                                         _("unknown clock adjustment
> '%s'"), tmp); +                    goto error;
> +                }
> +                switch (def->clock.offset) {
> +                case VIR_DOMAIN_CLOCK_OFFSET_LOCALTIME:
> +                    def->clock.data.variable.basis =
> VIR_DOMAIN_CLOCK_BASIS_LOCALTIME; +                    break;
> +                case VIR_DOMAIN_CLOCK_OFFSET_UTC:
> +                    def->clock.data.variable.basis =
> VIR_DOMAIN_CLOCK_BASIS_UTC; +                    break;
> +                }
                def->clock.offset = VIR_DOMAIN_CLOCK_OFFSET_VARIABLE;
> +                def->clock.data.variable.adjustment = val;
> +            }
> +            VIR_FREE(tmp);
> +        } else {
> +            def->clock.data.utc_reset = false;
> +        }
> +        break;
> +

Sincerely
Philipp
-- 
Philipp Hahn           Open Source Software Engineer      hahn at univention.de
Univention GmbH        Linux for Your Business        fon: +49 421 22 232- 0
Mary-Somerville-Str.1  D-28359 Bremen                 fax: +49 421 22 232-99
                                                   http://www.univention.de/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20120214/49a4e2fe/attachment-0001.sig>


More information about the libvir-list mailing list