]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Fix localtime handling for Xen-PV domains
authorPhilipp Hahn <hahn@univention.de>
Mon, 5 Sep 2011 06:22:36 +0000 (14:22 +0800)
committerDaniel Veillard <veillard@redhat.com>
Mon, 5 Sep 2011 06:22:36 +0000 (14:22 +0800)
At least Xen-3.4.3 translates the /vm/localtime SXPR value to
/domain/platform/localtime and /domain/image/{linux,hvm}/localtime when
the domain is defined.  When reading back that information libvirt only
handles HVM domains, but not PV domains: This results in libvirtd always
returning
    <clock offset="utc"/>
while Xend used (localtime 1).

For PV domains use /domain/image/linux/localtime.

src/xenxs/xen_sxpr.c

index 1a8a541c675b128c9b2e389f812c3f78ef57a097..086ad8b76b7767a185122917b17510e213f6736e 100644 (file)
@@ -1195,6 +1195,9 @@ xenParseSxpr(const struct sexpr *root,
             def->clock.ntimers = 1;
             def->clock.timers[0] = timer;
         }
+    } else { /* !hvm */
+        if (sexpr_int(root, "domain/image/linux/localtime"))
+            def->clock.offset = VIR_DOMAIN_CLOCK_OFFSET_LOCALTIME;
     }
 
     /* Current XenD allows localtime here, for PV and HVM */