[libvirt] [BUG] Xen->libvirt: localtime reported as UTC

Hello, just a report, no fix for that bug yet. If I create a domain and set <clock offset='localtime'/>, that information is correctly translated to Xends sxpr data, but on reading it back I get it reported as 'utc': # virsh dumpxml 85664d3f-68dd-a4c2-4d2f-be7f276b95f0 | grep clock <clock offset='utc'/> # gfind localtime ./85664d3f-68dd-a4c2-4d2f-be7f276b95f0/config.sxp: (platform ((device_model /usr/lib64/xen/bin/qemu-dm) (localtime 1))) ./85664d3f-68dd-a4c2-4d2f-be7f276b95f0/config.sxp: (localtime 1) BYtE Philipp -- Philipp Hahn Open Source Software Engineer hahn@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/

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 still tries to read /domain/localtime, which now isn't found anymore. Instead domxml-from-native should read back /domain/platform/localtime. This is tracked at <https://forge.univention.org/bugzilla/show_bug.cgi?id=22321> Signed-off-by: Philipp Hahn <hahn@univention.de> --- src/xenxs/xen_sxpr.c | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/xenxs/xen_sxpr.c b/src/xenxs/xen_sxpr.c index 0241695..5b997af 100644 --- a/src/xenxs/xen_sxpr.c +++ b/src/xenxs/xen_sxpr.c @@ -1194,12 +1194,15 @@ xenParseSxpr(const struct sexpr *root, if (sexpr_int(root, "domain/image/hvm/hap")) def->features |= (1 << VIR_DOMAIN_FEATURE_HAP); - /* Old XenD only allows localtime here for HVM */ + /* Old(?) XenD only allows localtime here for HVM */ if (sexpr_int(root, "domain/image/hvm/localtime")) def->clock.offset = VIR_DOMAIN_CLOCK_OFFSET_LOCALTIME; } - /* Current XenD allows localtime here, for PV and HVM */ + /* XenD-3.4.3 allows localtime here, for PV and HVM */ + if (sexpr_int(root, "domain/platform/localtime")) + def->clock.offset = VIR_DOMAIN_CLOCK_OFFSET_LOCALTIME; + /* Current(?) XenD allows localtime here, for PV and HVM */ if (sexpr_int(root, "domain/localtime")) def->clock.offset = VIR_DOMAIN_CLOCK_OFFSET_LOCALTIME; -- 1.7.1

On 04/27/2011 07:20 AM, Philipp Hahn wrote:
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 still tries to read /domain/localtime, which now isn't found anymore. Instead domxml-from-native should read back /domain/platform/localtime.
This is tracked at<https://forge.univention.org/bugzilla/show_bug.cgi?id=22321>
Looking through old threads - is this patch still needed? It didn't apply cleanly for me.
Signed-off-by: Philipp Hahn<hahn@univention.de> --- src/xenxs/xen_sxpr.c | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/xenxs/xen_sxpr.c b/src/xenxs/xen_sxpr.c index 0241695..5b997af 100644 --- a/src/xenxs/xen_sxpr.c +++ b/src/xenxs/xen_sxpr.c @@ -1194,12 +1194,15 @@ xenParseSxpr(const struct sexpr *root, if (sexpr_int(root, "domain/image/hvm/hap")) def->features |= (1<< VIR_DOMAIN_FEATURE_HAP);
- /* Old XenD only allows localtime here for HVM */ + /* Old(?) XenD only allows localtime here for HVM */ if (sexpr_int(root, "domain/image/hvm/localtime")) def->clock.offset = VIR_DOMAIN_CLOCK_OFFSET_LOCALTIME; }
- /* Current XenD allows localtime here, for PV and HVM */ + /* XenD-3.4.3 allows localtime here, for PV and HVM */ + if (sexpr_int(root, "domain/platform/localtime")) + def->clock.offset = VIR_DOMAIN_CLOCK_OFFSET_LOCALTIME; + /* Current(?) XenD allows localtime here, for PV and HVM */ if (sexpr_int(root, "domain/localtime")) def->clock.offset = VIR_DOMAIN_CLOCK_OFFSET_LOCALTIME;
-- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org

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. Signed-off-by: Philipp Hahn <hahn@univention.de> --- This is tracked at <https://forge.univention.org/bugzilla/show_bug.cgi?id=22321> --- src/xenxs/xen_sxpr.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/src/xenxs/xen_sxpr.c b/src/xenxs/xen_sxpr.c index 1f5be5f..ff8326f 100644 --- a/src/xenxs/xen_sxpr.c +++ b/src/xenxs/xen_sxpr.c @@ -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 */ -- 1.7.1

Ping? On Monday 15 August 2011 19:52:20 Philipp Hahn wrote:
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.
Signed-off-by: Philipp Hahn <hahn@univention.de> --- This is tracked at <https://forge.univention.org/bugzilla/show_bug.cgi?id=22321> --- src/xenxs/xen_sxpr.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/src/xenxs/xen_sxpr.c b/src/xenxs/xen_sxpr.c index 1f5be5f..ff8326f 100644 --- a/src/xenxs/xen_sxpr.c +++ b/src/xenxs/xen_sxpr.c @@ -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 */
-- Philipp Hahn Open Source Software Engineer hahn@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/ ---------------------------------------------------------------------------- Treffen Sie Univention auf der IT&Business vom 20. bis 22. September 2011 auf dem Gemeinschaftsstand der Open Source Business Alliance in Stuttgart in Halle 3 Stand 3D27-7.

On Mon, Aug 15, 2011 at 07:52:20PM +0200, Philipp Hahn wrote:
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.
Signed-off-by: Philipp Hahn <hahn@univention.de> --- This is tracked at <https://forge.univention.org/bugzilla/show_bug.cgi?id=22321> --- src/xenxs/xen_sxpr.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/src/xenxs/xen_sxpr.c b/src/xenxs/xen_sxpr.c index 1f5be5f..ff8326f 100644 --- a/src/xenxs/xen_sxpr.c +++ b/src/xenxs/xen_sxpr.c @@ -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 */
Sounds reasonnable :-) ACK pushed, thanks ! Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/

Hello Eric, Am Freitag 12 August 2011 23:40:34 schrieb Eric Blake:
On 04/27/2011 07:20 AM, Philipp Hahn wrote:
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 still tries to read /domain/localtime, which now isn't found anymore. Instead domxml-from-native should read back /domain/platform/localtime.
This is tracked at<https://forge.univention.org/bugzilla/show_bug.cgi?id=22321>
Looking through old threads - is this patch still needed?
I think that patch was wrong, but there was/is still a bug for Xen-PV domains; see other email for my patch. Sincerely Philipp Hahn -- Philipp Hahn Open Source Software Engineer hahn@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/
participants (3)
-
Daniel Veillard
-
Eric Blake
-
Philipp Hahn