[libvirt] [PATCH] XenXs: Update documentation

Fix several references to now renamed functions and parameters when the functions were moved from src/xen/ to src/xenxs/. Signed-off-by: Philipp Hahn <hahn@univention.de> --- src/xenxs/xen_sxpr.c | 222 +++++++++++++++++++++++++++++++++++++++++-------- 1 files changed, 185 insertions(+), 37 deletions(-) diff --git a/src/xenxs/xen_sxpr.c b/src/xenxs/xen_sxpr.c index 04ba5aa..ac15853 100644 --- a/src/xenxs/xen_sxpr.c +++ b/src/xenxs/xen_sxpr.c @@ -37,7 +37,7 @@ #include "xenxs_private.h" #include "xen_sxpr.h" -/* Get a domain id from a sexpr string */ +/* Get a domain id from a S-expression string */ int xenGetDomIdFromSxprString(const char *sexpr, int xendConfigVersion) { struct sexpr *root = string2sexpr(sexpr); @@ -50,7 +50,7 @@ int xenGetDomIdFromSxprString(const char *sexpr, int xendConfigVersion) return id; } -/* Get a domain id from a sexpr */ +/* Get a domain id from a S-expression */ int xenGetDomIdFromSxpr(const struct sexpr *root, int xendConfigVersion) { int id = -1; @@ -66,16 +66,15 @@ int xenGetDomIdFromSxpr(const struct sexpr *root, int xendConfigVersion) /***************************************************************** ****** - ****** Parsing of SEXPR into virDomainDef objects + ****** Parsing of S-Expression into virDomainDef objects ****** *****************************************************************/ /** - * xenParseSxprOS + * xenParseSxprOS: * @node: the root of the parsed S-Expression * @def: the domain config - * @hvm: true or 1 if no contains HVM S-Expression - * @bootloader: true or 1 if a bootloader is defined + * @hvm: true or 1 if node contains HVM S-Expression * * Parse the xend sexp for description of os and append it to buf. * @@ -166,6 +165,16 @@ no_memory: return -1; } + +/** + * xenParseSxprChar: + * @value: A string describing a character device. + * @tty: the console pty path + * + * Parse the xend S-expression for description of a character device. + * + * Returns a character device object or NULL in case of failure. + */ virDomainChrDefPtr xenParseSxprChar(const char *value, const char *tty) @@ -316,13 +325,15 @@ error: return NULL; } + /** - * xend_parse_sexp_desc_disks - * @conn: connection - * @root: root sexpr + * xenParseSxprDisks: + * @def: the domain config + * @root: root S-expression + * @hvm: true or 1 if node contains HVM S-Expression * @xendConfigVersion: version of xend * - * This parses out block devices from the domain sexpr + * This parses out block devices from the domain S-expression * * Returns 0 if successful or -1 if failed. */ @@ -518,6 +529,15 @@ error: } +/** + * xenParseSxprNets: + * @def: the domain config + * @root: root S-expression + * + * This parses out network devices from the domain S-expression + * + * Returns 0 if successful or -1 if failed. + */ static int xenParseSxprNets(virDomainDefPtr def, const struct sexpr *root) @@ -614,6 +634,15 @@ cleanup: } +/** + * xenParseSxprSound: + * @def: the domain config + * @str: comma separated list of sound models + * + * This parses out sound devices from the domain S-expression + * + * Returns 0 if successful or -1 if failed. + */ int xenParseSxprSound(virDomainDefPtr def, const char *str) @@ -692,6 +721,15 @@ error: } +/** + * xenParseSxprUSB: + * @def: the domain config + * @root: root S-expression + * + * This parses out USB devices from the domain S-expression + * + * Returns 0 if successful or -1 if failed. + */ static int xenParseSxprUSB(virDomainDefPtr def, const struct sexpr *root) @@ -733,6 +771,19 @@ no_memory: return -1; } + +/* + * xenParseSxprGraphicsOld: + * @def: the domain config + * @root: root S-expression + * @hvm: true or 1 if root contains HVM S-Expression + * @xendConfigVersion: version of xend + * @vncport: VNC port number + * + * This parses out VNC devices from the domain S-expression + * + * Returns 0 if successful or -1 if failed. + */ static int xenParseSxprGraphicsOld(virDomainDefPtr def, const struct sexpr *root, @@ -821,6 +872,16 @@ error: } +/* + * xenParseSxprGraphicsNew: + * @def: the domain config + * @root: root S-expression + * @vncport: VNC port number + * + * This parses out VNC devices from the domain S-expression + * + * Returns 0 if successful or -1 if failed. + */ static int xenParseSxprGraphicsNew(virDomainDefPtr def, const struct sexpr *root, int vncport) @@ -918,11 +979,13 @@ error: return -1; } + /** - * xenParseSxprPCI + * xenParseSxprPCI: + * @def: the domain config * @root: root sexpr * - * This parses out block devices from the domain sexpr + * This parses out PCI devices from the domain sexpr * * Returns 0 if successful or -1 if failed. */ @@ -1044,16 +1107,17 @@ error: /** * xenParseSxpr: - * @conn: the connection associated with the XML * @root: the root of the parsed S-Expression * @xendConfigVersion: version of xend * @cpus: set of cpus the domain may be pinned to + * @tty: the console pty path + * @vncport: VNC port number * - * Parse the xend sexp description and turn it into the XML format similar - * to the one unsed for creation. + * Parse the xend S-expression description and turn it into a virDomainDefPtr + * representing these settings as closeley as is practical. * - * Returns the 0 terminated XML string or NULL in case of error. - * the caller must free() the returned value. + * Returns the domain config or NULL in case of error. + * The caller must free() the returned value. */ virDomainDefPtr xenParseSxpr(const struct sexpr *root, @@ -1424,6 +1488,20 @@ error: return NULL; } + +/** + * xenParseSxprString: + * @sexpr: the root of the parsed S-Expression + * @xendConfigVersion: version of xend + * @tty: the console pty path + * @vncport: VNC port number + * + * Parse the xend S-expression description and turn it into a virDomainDefPtr + * representing these settings as closeley as is practical. + * + * Returns the domain config or NULL in case of error. + * The caller must free() the returned value. + */ virDomainDefPtr xenParseSxprString(const char *sexpr, int xendConfigVersion, char *tty, int vncport) @@ -1449,15 +1527,12 @@ xenParseSxprString(const char *sexpr, /** - * virtDomainParseXMLGraphicsDescVFB: - * @conn: pointer to the hypervisor connection - * @node: node containing graphics description - * @buf: a buffer for the result S-Expr + * xenFormatSxprGraphicsNew: + * @def: the domain config + * @buf: a buffer for the result S-expression * - * Parse the graphics part of the XML description and add it to the S-Expr - * in buf. This is a temporary interface as the S-Expr interface will be - * replaced by XML-RPC in the future. However the XML format should stay - * valid over time. + * Convert the graphics part of the domain description into a S-expression + * in buf. (HVM > 3.0.4 or PV > 3.0.3) * * Returns 0 in case of success, -1 in case of error */ @@ -1508,6 +1583,17 @@ xenFormatSxprGraphicsNew(virDomainGraphicsDefPtr def, } +/** + * xenFormatSxprGraphicsOld: + * @def: the domain config + * @buf: a buffer for the result S-expression + * @xendConfigVersion: version of xend + * + * Convert the graphics part of the domain description into a S-expression + * in buf. (HVM <= 3.0.4 or PV <= 3.0.3) + * + * Returns 0 in case of success, -1 in case of error + */ static int xenFormatSxprGraphicsOld(virDomainGraphicsDefPtr def, virBufferPtr buf, @@ -1553,6 +1639,17 @@ xenFormatSxprGraphicsOld(virDomainGraphicsDefPtr def, return 0; } + +/** + * xenFormatSxprChr: + * @def: the domain config + * @buf: a buffer for the result S-expression + * + * Convert the character deivce part of the domain config into a S-expression + * in buf. + * + * Returns 0 in case of success, -1 in case of error + */ int xenFormatSxprChr(virDomainChrDefPtr def, virBufferPtr buf) @@ -1631,15 +1728,14 @@ xenFormatSxprChr(virDomainChrDefPtr def, /** - * virDomainParseXMLDiskDesc: - * @node: node containing disk description - * @buf: a buffer for the result S-Expr + * xenFormatSxprDisk: + * @node: node containing the disk description + * @buf: a buffer for the result S-expression + * @hvm: true or 1 if domain is HVM * @xendConfigVersion: xend configuration file format + * @isAttach: create expression for device attach (1). * - * Parse the one disk in the XML description and add it to the S-Expr in buf - * This is a temporary interface as the S-Expr interface - * will be replaced by XML-RPC in the future. However the XML format should - * stay valid over time. + * Convert the disk device part of the domain config into a S-expresssion in buf. * * Returns 0 in case of success, -1 in case of error. */ @@ -1757,12 +1853,15 @@ xenFormatSxprDisk(virDomainDiskDefPtr def, } /** - * xenFormatSxprNet - * @node: node containing the interface description - * @buf: a buffer for the result S-Expr + * xenFormatSxprNet: + * @conn: connection + * @def: the domain config + * @buf: a buffer for the result S-expression + * @hvm: true or 1 if domain is HVM * @xendConfigVersion: xend configuration file format + * @isAttach: create expression for device attach (1). * - * Parse the one interface the XML description and add it to the S-Expr in buf + * Convert the interface description of the domain config into a S-expression in buf. * This is a temporary interface as the S-Expr interface * will be replaced by XML-RPC in the future. However the XML format should * stay valid over time. @@ -1893,6 +1992,15 @@ xenFormatSxprNet(virConnectPtr conn, } +/** + * xenFormatSxprPCI: + * @def: the device config + * @buf: a buffer for the result S-expression + * + * Convert a single PCI device part of the domain config into a S-expresssion in buf. + * + * Returns 0 in case of success, -1 in case of error. + */ static void xenFormatSxprPCI(virDomainHostdevDefPtr def, virBufferPtr buf) @@ -1904,6 +2012,17 @@ xenFormatSxprPCI(virDomainHostdevDefPtr def, def->source.subsys.u.pci.function); } + +/** + * xenFormatSxprOnePCI: + * @def: the device config + * @buf: a buffer for the result S-expression + * @detach: create expression for device detach (1). + * + * Convert a single PCI device part of the domain config into a S-expresssion in buf. + * + * Returns 0 in case of success, -1 in case of error. + */ int xenFormatSxprOnePCI(virDomainHostdevDefPtr def, virBufferPtr buf, @@ -1926,6 +2045,16 @@ xenFormatSxprOnePCI(virDomainHostdevDefPtr def, return 0; } + +/** + * xenFormatSxprAllPCI: + * @def: the domain config + * @buf: a buffer for the result S-expression + * + * Convert all PCI device parts of the domain config into a S-expresssion in buf. + * + * Returns 0 in case of success, -1 in case of error. + */ static int xenFormatSxprAllPCI(virDomainDefPtr def, virBufferPtr buf) @@ -1973,6 +2102,16 @@ xenFormatSxprAllPCI(virDomainDefPtr def, return 0; } + +/** + * xenFormatSxprSound: + * @def: the domain config + * @buf: a buffer for the result S-expression + * + * Convert all sound device parts of the domain config into S-expression in buf. + * + * Returns 0 if successful or -1 if failed. + */ int xenFormatSxprSound(virDomainDefPtr def, virBufferPtr buf) @@ -2001,6 +2140,15 @@ xenFormatSxprSound(virDomainDefPtr def, } +/** + * xenFormatSxprInput: + * @input: the input config + * @buf: a buffer for the result S-expression + * + * Convert all input device parts of the domain config into S-expression in buf. + * + * Returns 0 if successful or -1 if failed. + */ static int xenFormatSxprInput(virDomainInputDefPtr input, virBufferPtr buf) @@ -2033,7 +2181,7 @@ verify(MAX_VIRT_CPUS <= sizeof(1UL) * CHAR_BIT); * @def: domain config definition * @xendConfigVersion: xend configuration file format * - * Generate an SEXPR representing the domain configuration. + * Generate an S-expression representing the domain configuration. * * Returns the 0 terminated S-Expr string or NULL in case of error. * the caller must free() the returned value. -- 1.7.1

For PV, Xen implements the <clock offset='utc'> and <clock offset='localtime'> behaviour, while for HV it implements <clock offset='variable'>. This difference is important for domUs, which switch daylight saving on there own, since the state is kept inside the VM and must be in sync with the RTC provided by Xen. For backward compatibility with previous versions of libvirt Xen-HV still accepts 'utc' and 'localtime', but they are converted to 'variable' on the next read-back from Xend to libvirt, since this is what Xen implements: The RTC is NOT reset back to the specified time on next restart, but the previous offset is re-used. Xen-HV also supports rtc_timeoffset relative to localtime=1, but currently there is no mapping to libvirts <clock> syntax; such a configuration will return an error. Signed-off-by: Philipp Hahn <hahn@univention.de> --- src/xenxs/xen_sxpr.c | 85 ++++++++++++++++++++++++++++---------------------- src/xenxs/xen_xm.c | 70 +++++++++++++++++++++++++++-------------- 2 files changed, 94 insertions(+), 61 deletions(-) diff --git a/src/xenxs/xen_sxpr.c b/src/xenxs/xen_sxpr.c index ac15853..19679fd 100644 --- a/src/xenxs/xen_sxpr.c +++ b/src/xenxs/xen_sxpr.c @@ -1247,7 +1247,6 @@ xenParseSxpr(const struct sexpr *root, } else def->onCrash = VIR_DOMAIN_LIFECYCLE_DESTROY; - def->clock.offset = VIR_DOMAIN_CLOCK_OFFSET_UTC; if (hvm) { if (sexpr_int(root, "domain/image/hvm/acpi")) def->features |= (1 << VIR_DOMAIN_FEATURE_ACPI); @@ -1260,9 +1259,13 @@ xenParseSxpr(const struct sexpr *root, if (sexpr_int(root, "domain/image/hvm/viridian")) def->features |= (1 << VIR_DOMAIN_FEATURE_VIRIDIAN); - /* Old XenD only allows localtime here for HVM */ - if (sexpr_int(root, "domain/image/hvm/localtime")) - def->clock.offset = VIR_DOMAIN_CLOCK_OFFSET_LOCALTIME; + def->clock.offset = VIR_DOMAIN_CLOCK_OFFSET_VARIABLE; + def->clock.data.adjustment = sexpr_int(root, "domain/image/hvm/rtc_timeoffset"); + if (def->clock.data.adjustment && sexpr_int(root, "domain/image/hvm/localtime")) { + XENXS_ERROR(VIR_ERR_INTERNAL_ERROR, + "%s", _("domain information incompatible: localtime=1 while rtc_timeoffset!=0")); + goto error; + } if (sexpr_lookup(root, "domain/image/hvm/hpet")) { virDomainTimerDefPtr timer; @@ -1280,10 +1283,12 @@ xenParseSxpr(const struct sexpr *root, def->clock.ntimers = 1; def->clock.timers[0] = timer; } - } else { /* !hvm */ + } else { if (sexpr_int(root, "domain/image/linux/localtime")) def->clock.offset = VIR_DOMAIN_CLOCK_OFFSET_LOCALTIME; - } + else + def->clock.offset = VIR_DOMAIN_CLOCK_OFFSET_UTC; + } /* !hvm */ /* Current XenD allows localtime here, for PV and HVM */ if (sexpr_int(root, "domain/localtime")) @@ -2196,6 +2201,7 @@ xenFormatSxpr(virConnectPtr conn, const char *tmp; char *bufout; int hvm = 0, i; + int vmlocaltime = 0, rtc_timeoffset = 0; VIR_DEBUG("Formatting domain sexpr"); @@ -2255,31 +2261,15 @@ xenFormatSxpr(virConnectPtr conn, } virBufferAsprintf(&buf, "(on_crash '%s')", tmp); - /* Set localtime here for current XenD (both PV & HVM) */ - if (def->clock.offset == VIR_DOMAIN_CLOCK_OFFSET_LOCALTIME) { - if (def->clock.data.timezone) { - XENXS_ERROR(VIR_ERR_CONFIG_UNSUPPORTED, - "%s", _("configurable timezones are not supported")); - goto error; - } + if (STREQ(def->os.type, "hvm")) + hvm = 1; - virBufferAddLit(&buf, "(localtime 1)"); - } else if (def->clock.offset != VIR_DOMAIN_CLOCK_OFFSET_UTC) { - XENXS_ERROR(VIR_ERR_CONFIG_UNSUPPORTED, - _("unsupported clock offset '%s'"), - virDomainClockOffsetTypeToString(def->clock.offset)); - goto error; - } + if (hvm) + virBufferAddLit(&buf, "(image (hvm "); + else + virBufferAddLit(&buf, "(image (linux "); if (!def->os.bootloader) { - if (STREQ(def->os.type, "hvm")) - hvm = 1; - - if (hvm) - virBufferAddLit(&buf, "(image (hvm "); - else - virBufferAddLit(&buf, "(image (linux "); - if (hvm && def->os.loader == NULL) { XENXS_ERROR(VIR_ERR_INTERNAL_ERROR, @@ -2424,17 +2414,13 @@ xenFormatSxpr(virConnectPtr conn, virBufferAddLit(&buf, "(serial none)"); } - /* Set localtime here to keep old XenD happy for HVM */ - if (def->clock.offset == VIR_DOMAIN_CLOCK_OFFSET_LOCALTIME) - virBufferAddLit(&buf, "(localtime 1)"); - if (def->sounds) { virBufferAddLit(&buf, "(soundhw '"); if (xenFormatSxprSound(def, &buf) < 0) goto error; virBufferAddLit(&buf, "')"); } - } + } /* hvm */ /* get the device emulation model */ if (def->emulator && (hvm || xendConfigVersion >= 3)) @@ -2458,15 +2444,40 @@ xenFormatSxpr(virConnectPtr conn, &buf, xendConfigVersion) < 0) goto error; } - - virBufferAddLit(&buf, "))"); } else { /* PV domains accept kernel cmdline args */ if (def->os.cmdline) { - virBufferEscapeSexpr(&buf, "(image (linux (args '%s')))", - def->os.cmdline); + virBufferEscapeSexpr(&buf, "(args '%s')", def->os.cmdline); + } + } /* os.bootloader */ + + /* + * PV: UTC and LOCALTIME. + * HV: VARIABLE + simulated UTC and LOCALTIME for backward compatibility. + */ + switch (def->clock.offset) { + case VIR_DOMAIN_CLOCK_OFFSET_LOCALTIME: + vmlocaltime = 1; + break; + case VIR_DOMAIN_CLOCK_OFFSET_UTC: + break; + case VIR_DOMAIN_CLOCK_OFFSET_VARIABLE: + if (hvm) { + rtc_timeoffset = def->clock.data.adjustment; + break; } + /* fall through */ + default: + XENXS_ERROR(VIR_ERR_CONFIG_UNSUPPORTED, + _("unsupported clock offset '%s'"), + virDomainClockOffsetTypeToString(def->clock.offset)); + goto error; } + virBufferAsprintf(&buf, "(localtime %d)", vmlocaltime); + if (hvm) + virBufferAsprintf(&buf, "(rtc_timeoffset %d)", rtc_timeoffset); + + virBufferAddLit(&buf, "))"); /* closes (image(hvm|linux */ for (i = 0 ; i < def->ndisks ; i++) if (xenFormatSxprDisk(def->disks[i], diff --git a/src/xenxs/xen_xm.c b/src/xenxs/xen_xm.c index 0aa04f3..022bcb8 100644 --- a/src/xenxs/xen_xm.c +++ b/src/xenxs/xen_xm.c @@ -414,9 +414,22 @@ xenParseXM(virConfPtr conf, int xendConfigVersion, if (xenXMConfigGetBool(conf, "localtime", &vmlocaltime, 0) < 0) goto cleanup; - def->clock.offset = vmlocaltime ? - VIR_DOMAIN_CLOCK_OFFSET_LOCALTIME : - VIR_DOMAIN_CLOCK_OFFSET_UTC; + if (hvm) { + unsigned long rtc_timeoffset; + if (xenXMConfigGetULong(conf, "rtc_timeoffset", &rtc_timeoffset, 0) < 0) + goto cleanup; + def->clock.offset = VIR_DOMAIN_CLOCK_OFFSET_VARIABLE; + def->clock.data.adjustment = (int)rtc_timeoffset; + if (vmlocaltime) { + XENXS_ERROR(VIR_ERR_INTERNAL_ERROR, + "%s", _("domain information incompatible: localtime=1 while rtc_timeoffset!=0")); + goto cleanup; + } + } else { + def->clock.offset = vmlocaltime ? + VIR_DOMAIN_CLOCK_OFFSET_LOCALTIME : + VIR_DOMAIN_CLOCK_OFFSET_UTC; + } /* !hvm */ if (xenXMConfigCopyStringOpt(conf, "device_model", &def->emulator) < 0) goto cleanup; @@ -1456,6 +1469,7 @@ virConfPtr xenFormatXM(virConnectPtr conn, char uuid[VIR_UUID_STRING_BUFLEN]; virConfValuePtr diskVal = NULL; virConfValuePtr netVal = NULL; + int vmlocaltime = 0, rtc_timeoffset = 0; if (!(conf = virConfNew())) goto cleanup; @@ -1557,26 +1571,6 @@ virConfPtr xenFormatXM(virConnectPtr conn, goto no_memory; } - if (def->clock.offset == VIR_DOMAIN_CLOCK_OFFSET_LOCALTIME) { - if (def->clock.data.timezone) { - XENXS_ERROR(VIR_ERR_CONFIG_UNSUPPORTED, - "%s", _("configurable timezones are not supported")); - goto cleanup; - } - - if (xenXMConfigSetInt(conf, "localtime", 1) < 0) - goto no_memory; - } else if (def->clock.offset == VIR_DOMAIN_CLOCK_OFFSET_UTC) { - if (xenXMConfigSetInt(conf, "localtime", 0) < 0) - goto no_memory; - } else { - /* XXX We could support Xen's rtc clock offset */ - XENXS_ERROR(VIR_ERR_CONFIG_UNSUPPORTED, - _("unsupported clock offset '%s'"), - virDomainClockOffsetTypeToString(def->clock.offset)); - goto cleanup; - } - for (i = 0; i < def->clock.ntimers; i++) { if (def->clock.timers[i]->name == VIR_DOMAIN_TIMER_NAME_HPET && def->clock.timers[i]->present != -1 && @@ -1615,7 +1609,35 @@ virConfPtr xenFormatXM(virConnectPtr conn, if (def->os.cmdline && xenXMConfigSetString(conf, "extra", def->os.cmdline) < 0) goto no_memory; - + } /* !hvm */ + + /* + * PV: UTC and LOCALTIME. + * HV: VARIABLE + simulated UTC and LOCALTIME for backward compatibility. + */ + switch (def->clock.offset) { + case VIR_DOMAIN_CLOCK_OFFSET_LOCALTIME: + vmlocaltime = 1; + break; + case VIR_DOMAIN_CLOCK_OFFSET_UTC: + break; + case VIR_DOMAIN_CLOCK_OFFSET_VARIABLE: + if (hvm) { + rtc_timeoffset = def->clock.data.adjustment; + break; + } + /* fall through */ + default: + XENXS_ERROR(VIR_ERR_CONFIG_UNSUPPORTED, + _("unsupported clock offset '%s'"), + virDomainClockOffsetTypeToString(def->clock.offset)); + goto cleanup; + } + if (xenXMConfigSetInt(conf, "localtime", vmlocaltime) < 0) + goto no_memory; + if (hvm) { + if (xenXMConfigSetInt(conf, "rtc_timeoffset", rtc_timeoffset) < 0) + goto no_memory; } if (!(lifecycle = virDomainLifecycleTypeToString(def->onPoweroff))) { -- 1.7.1

On Tue, Jan 17, 2012 at 05:02:14PM +0100, Philipp Hahn wrote:
For PV, Xen implements the <clock offset='utc'> and <clock offset='localtime'> behaviour, while for HV it implements <clock offset='variable'>. This difference is important for domUs, which switch daylight saving on there own, since the state is kept inside the VM and must be in sync with the RTC provided by Xen.
What versions of Xen is that true for ? I didn't think that old versions behaved this way for HVM. The libvirt Xen driver is still intended to support the RHEL5 vintage Xen code (which is based on 3.0.3) Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|

Hello Daniel, "Daniel P. Berrange" <berrange@redhat.com> wrote:
On Tue, Jan 17, 2012 at 05:02:14PM +0100, Philipp Hahn wrote:
For PV, Xen implements the <clock offset='utc'> and <clock offset='localtime'> behaviour, while for HV it implements <clock offset='variable'>. This difference is important for domUs, which switch daylight saving on there own, since the state is kept inside the VM and must be in sync with the RTC provided by Xen.
What versions of Xen is that true for ?
I tested xen-3.4 and 4.1 and had a short look at 3.2, which all seemd to have that behaviour.
I didn't think that old versions behaved this way for HVM. The libvirt Xen driver is still intended to support the RHEL5 vintage Xen code (which is based on 3.0.3)
I'll try to install RHEL5 and take a look, but not before friday. Sincerely Philipp

Hello Daniel, On Tuesday 17 January 2012 22:24:11 Daniel P. Berrange wrote:
On Tue, Jan 17, 2012 at 05:02:14PM +0100, Philipp Hahn wrote:
For PV, Xen implements the <clock offset='utc'> and <clock offset='localtime'> behaviour, while for HV it implements <clock offset='variable'>. This difference is important for domUs, which switch daylight saving on there own, since the state is kept inside the VM and must be in sync with the RTC provided by Xen.
What versions of Xen is that true for ? I didn't think that old versions behaved this way for HVM. The libvirt Xen driver is still intended to support the RHEL5 vintage Xen code (which is based on 3.0.3)
To me it looks like CentOS5 (since I don't have RHEL5) has the Xen-3.0.3 user-land XenD (rpm -q xen → xen-3.0.3-132.el5) but the Xen-3.1.2 hypervisor (xm info → 3.1.2-.2-274.el5). Relevant for this change seems only the version of XenD, which returns xendConfigVersion=2. This is a version without "managed domain" support, which was added in the 3.1.x branch <http://xenbits.xen.org/hg/xen-3.1-testing.hg/rev/7e431ea834a8>. The generation bump to xendConfig_version=3 happend in 3.0.4 for "Live Cycle" support <http://xenbits.xen.org/hg/xen-3.0.4-testing.hg/rev/1c51c580dc05>. The bump to 4 was in the 3.0.5 → 3.1.0 transition <http://xenbits.xen.org/hg/xen-3.1-testing.hg/rev/887fa548f650> So for XenD version _ its _: - < 3.1: "utc" or "localtime" (because there is no XenD keeping track of the modified rtc_timeoffset) - >= 3.1: managed HV domains: "variable" (XenD keeps track) - >= 3.1: managed PV domains: "utc" or "localtime" (they don't have a RTC but can access a PV-clock, which gets initialized to either "utc" or "localtime". As far as I know the offset can't be changed by the domU and is not visible in any tool, only the "is_utc/localtime" flag is visible) - >= 3.1: "xm" domains: same as with "managed domains". The "variable" offset is tracked by XenD and survives a "reboot", but as with other transient domains, the information is lost after "destroy". Patch will (hopefully) follow soon. Sincerely 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/
participants (2)
-
Daniel P. Berrange
-
Philipp Hahn