[libvirt] [PATCHv2 0/3] Xen: Fix <clock> handling

Before version 3.1 xen only implemented clock/@offset='utc' and 'localtime'. With the introduction of managed domains in 3.1 xend keeps track of the rtc_timeoffset, even over reboots. This translates to libvirts clock/@offset='variable' variant. Be advised that only HV domains have a RTC. In addition xen also supports a variant where the offset is tracked to 'localtime', which is currently not supported by libvirt. To make matters worse, this was somehow broken in some versions of xen and was finally fixed with version xen-3.4. The following patch set ... * adds support for handling variable offsets relative to localtime, * fixes libvirt to use clock/@offset='variable' for newer xen versions, * adapts the test suit accordingly I've tested this on CenOS5 (xend-3.0.3 + 3.1.2 hypervisor?), UCS-2.3 (xen-3.2.1), UCS-2.4 (xen-3.4.3) and UCS-3.0 (xen-4.1.2). Since v1: + fix handling of direct-PV-domains + added handling of localtime=1 + rtc_timeoffset + fixed test suite Questions: 1. Handling of legacy XML domain configurations I'm reluctant to define LIBVIRT_XEND_CLOCK_STRICT, since this would probably break many existing XML configuration files, since they would be rejected libvirt now for still using clock/@offset='utc'/'localtime'. Luckily for us libvirt doesn't support snapshots with xen, because then this XML configuration would be stored in the snapshot meta data, rendering them all invalid. 2. Error path handling There are now a lot of different cases (PV, HV<3.1, HV>3.1), which all have the same error path. This is somehow ugly to code in C, I hope it's okay to use vmlocaltime=-1 to indicate an error instead of using "goto". But if you have a better idea, please feel free to comments. 3. libvirt-0.9.10 or .11 This patch-series should probably receive some more testing, so for 0.9.10 it's too late. If it's not included, I'd need to update the reference to the version when this patch will get in. Philipp Hahn (3): Support clock=variable relative to localtime Xen: Fix <clock> handling Xen: Adapt <clock> tests docs/formatdomain.html.in | 7 +- docs/schemas/domaincommon.rng | 8 + src/conf/domain_conf.c | 24 +++- src/conf/domain_conf.h | 15 ++- src/libvirt_private.syms | 1 + src/qemu/qemu_command.c | 8 +- src/qemu/qemu_process.c | 2 +- src/xenxs/xen_sxpr.c | 161 +++++++++++++++----- src/xenxs/xen_xm.c | 116 +++++++++++--- .../qemuxml2argv-clock-variable.xml | 2 +- tests/xmconfigdata/sexpr2xml-pv-bootloader.cfg | 1 + tests/xmconfigdata/test-fullvirt-force-hpet.cfg | 2 +- tests/xmconfigdata/test-fullvirt-force-nohpet.cfg | 2 +- tests/xmconfigdata/test-fullvirt-old-cdrom.cfg | 2 +- tests/xmconfigdata/test-paravirt-net-e1000.cfg | 1 + tests/xmconfigdata/test-paravirt-net-vifname.cfg | 1 + .../test-paravirt-new-pvfb-vncdisplay.cfg | 1 + tests/xmconfigdata/test-paravirt-new-pvfb.cfg | 1 + .../test-paravirt-old-pvfb-vncdisplay.cfg | 1 + tests/xmconfigdata/test-paravirt-old-pvfb.cfg | 1 + tests/xmconfigdata/test-paravirt-vcpu.cfg | 1 + tests/xml2sexprdata/xml2sexpr-boot-grub.sexpr | 1 + tests/xml2sexprdata/xml2sexpr-bridge-ipaddr.sexpr | 4 +- tests/xml2sexprdata/xml2sexpr-curmem.sexpr | 1 + .../xml2sexpr-disk-block-shareable.sexpr | 4 +- tests/xml2sexprdata/xml2sexpr-disk-block.sexpr | 4 +- .../xml2sexprdata/xml2sexpr-disk-drv-blkback.sexpr | 4 +- .../xml2sexpr-disk-drv-blktap-qcow.sexpr | 4 +- .../xml2sexpr-disk-drv-blktap-raw.sexpr | 4 +- .../xml2sexprdata/xml2sexpr-disk-drv-blktap.sexpr | 4 +- .../xml2sexpr-disk-drv-blktap2-raw.sexpr | 4 +- .../xml2sexprdata/xml2sexpr-disk-drv-blktap2.sexpr | 4 +- tests/xml2sexprdata/xml2sexpr-disk-drv-loop.sexpr | 4 +- tests/xml2sexprdata/xml2sexpr-disk-file.sexpr | 4 +- tests/xml2sexprdata/xml2sexpr-escape.sexpr | 1 + tests/xml2sexprdata/xml2sexpr-fv-force-hpet.sexpr | 1 + .../xml2sexprdata/xml2sexpr-fv-force-nohpet.sexpr | 1 + tests/xml2sexprdata/xml2sexpr-fv-kernel.sexpr | 1 + tests/xml2sexprdata/xml2sexpr-fv-localtime.sexpr | 5 +- tests/xml2sexprdata/xml2sexpr-fv-net-ioemu.sexpr | 3 +- .../xml2sexprdata/xml2sexpr-fv-net-netfront.sexpr | 3 +- .../xml2sexprdata/xml2sexpr-fv-parallel-tcp.sexpr | 1 + .../xml2sexpr-fv-serial-dev-2-ports.sexpr | 3 +- .../xml2sexpr-fv-serial-dev-2nd-port.sexpr | 1 + tests/xml2sexprdata/xml2sexpr-fv-serial-file.sexpr | 3 +- tests/xml2sexprdata/xml2sexpr-fv-serial-null.sexpr | 1 + tests/xml2sexprdata/xml2sexpr-fv-serial-pipe.sexpr | 3 +- tests/xml2sexprdata/xml2sexpr-fv-serial-pty.sexpr | 1 + .../xml2sexprdata/xml2sexpr-fv-serial-stdio.sexpr | 1 + .../xml2sexpr-fv-serial-tcp-telnet.sexpr | 1 + tests/xml2sexprdata/xml2sexpr-fv-serial-tcp.sexpr | 1 + tests/xml2sexprdata/xml2sexpr-fv-serial-udp.sexpr | 1 + tests/xml2sexprdata/xml2sexpr-fv-serial-unix.sexpr | 1 + tests/xml2sexprdata/xml2sexpr-fv-sound.sexpr | 1 + tests/xml2sexprdata/xml2sexpr-fv-usbmouse.sexpr | 1 + tests/xml2sexprdata/xml2sexpr-fv-usbtablet.sexpr | 3 +- tests/xml2sexprdata/xml2sexpr-fv-utc.sexpr | 1 + tests/xml2sexprdata/xml2sexpr-fv-v2.sexpr | 1 + tests/xml2sexprdata/xml2sexpr-fv-vncunused.sexpr | 3 +- tests/xml2sexprdata/xml2sexpr-fv.sexpr | 1 + tests/xml2sexprdata/xml2sexpr-net-bridged.sexpr | 2 +- tests/xml2sexprdata/xml2sexpr-net-e1000.sexpr | 2 +- tests/xml2sexprdata/xml2sexpr-net-routed.sexpr | 2 +- .../xml2sexprdata/xml2sexpr-no-source-cdrom.sexpr | 1 + tests/xml2sexprdata/xml2sexpr-pci-devs.sexpr | 2 +- .../xml2sexpr-pv-bootloader-cmdline.sexpr | 1 + tests/xml2sexprdata/xml2sexpr-pv-bootloader.sexpr | 4 +- tests/xml2sexprdata/xml2sexpr-pv-vcpus.sexpr | 2 +- .../xml2sexprdata/xml2sexpr-pv-vfb-new-auto.sexpr | 2 +- tests/xml2sexprdata/xml2sexpr-pv-vfb-new.sexpr | 2 +- tests/xml2sexprdata/xml2sexpr-pv-vfb-orig.sexpr | 1 + tests/xml2sexprdata/xml2sexpr-pv.sexpr | 2 +- 72 files changed, 363 insertions(+), 108 deletions(-)

Since Xen 3.1 the clock=variable semantic is supported. In addition to qemu/kvm Xen also knows about a variant where the offset is relative to 'localtime' instead of 'utc'. Extends the libvirt structure with a flag to specify, if the offset is relative to 'localtime' or 'utc'. Adapt the only user 'qemu' to the new name. Extend the RelaxNG schema accordingly. Document the new 'basis' attribute in the HTML documentation. Adapt test for the new attribute. Signed-off-by: Philipp Hahn <hahn@univention.de> --- docs/formatdomain.html.in | 7 ++++- docs/schemas/domaincommon.rng | 8 ++++++ src/conf/domain_conf.c | 24 ++++++++++++++++--- src/conf/domain_conf.h | 15 ++++++++++- src/libvirt_private.syms | 1 + src/qemu/qemu_command.c | 8 +++++- src/qemu/qemu_process.c | 2 +- .../qemuxml2argv-clock-variable.xml | 2 +- 8 files changed, 56 insertions(+), 11 deletions(-) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 29497a0..a849774 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -935,12 +935,15 @@ <dt><code>variable</code></dt> <dd> The guest clock will have an arbitrary offset applied - relative to UTC. The delta relative to UTC is specified + relative to UTC or localtime, depending on the <code>basis</code> + attribute. The delta relative to UTC (or localtime) is specified in seconds, using the <code>adjustment</code> attribute. The guest is free to adjust the RTC over time and expect that it will be honoured at next reboot. This is in - contrast to 'utc' mode, where the RTC adjustments are + contrast to 'utc' and 'localtime' mode, where the RTC adjustments are lost at each reboot. <span class="since">Since 0.7.7</span> + The <code>basis</code> attribute can be either 'utc' (default) or + 'localtime'. <span class="since">Since 0.9.10</span> </dd> </dl> <p> diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 8111045..9735e7c 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -576,6 +576,14 @@ <ref name="timeDelta"/> </attribute> </optional> + <optional> + <attribute name="basis"> + <choice> + <value>utc</value> + <value>localtime</value> + </choice> + </attribute> + </optional> </group> </choice> <zeroOrMore> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index aa4b32d..38e3f36 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -575,6 +575,10 @@ VIR_ENUM_IMPL(virDomainClockOffset, VIR_DOMAIN_CLOCK_OFFSET_LAST, "variable", "timezone"); +VIR_ENUM_IMPL(virDomainClockBasis, VIR_DOMAIN_CLOCK_BASIS_LAST, + "utc", + "localtime"); + VIR_ENUM_IMPL(virDomainTimerName, VIR_DOMAIN_TIMER_NAME_LAST, "platform", "pit", @@ -7469,8 +7473,19 @@ static virDomainDefPtr virDomainDefParseXML(virCapsPtr caps, switch (def->clock.offset) { case VIR_DOMAIN_CLOCK_OFFSET_VARIABLE: if (virXPathLongLong("number(./clock/@adjustment)", ctxt, - &def->clock.data.adjustment) < 0) - def->clock.data.adjustment = 0; + &def->clock.data.variable.adjustment) < 0) + def->clock.data.variable.adjustment = 0; + tmp = virXPathString("string(./clock/@basis)", ctxt); + if (tmp) { + if ((def->clock.data.variable.basis = virDomainClockBasisTypeFromString(tmp)) < 0) { + virDomainReportError(VIR_ERR_INTERNAL_ERROR, + _("unknown clock basis '%s'"), tmp); + goto error; + } + VIR_FREE(tmp); + } else { + def->clock.data.variable.basis = VIR_DOMAIN_CLOCK_BASIS_UTC; + } break; case VIR_DOMAIN_CLOCK_OFFSET_TIMEZONE: @@ -11831,8 +11846,9 @@ virDomainDefFormatInternal(virDomainDefPtr def, virDomainClockOffsetTypeToString(def->clock.offset)); switch (def->clock.offset) { case VIR_DOMAIN_CLOCK_OFFSET_VARIABLE: - virBufferAsprintf(buf, " adjustment='%lld'", - def->clock.data.adjustment); + virBufferAsprintf(buf, " adjustment='%lld' basis='%s'", + def->clock.data.variable.adjustment, + virDomainClockBasisTypeToString(def->clock.data.variable.basis)); break; case VIR_DOMAIN_CLOCK_OFFSET_TIMEZONE: virBufferEscapeString(buf, " timezone='%s'", def->clock.data.timezone); diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 0a2795d..54eb732 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -1366,15 +1366,25 @@ enum virDomainClockOffsetType { VIR_DOMAIN_CLOCK_OFFSET_LAST, }; +enum virDomainClockBasis { + VIR_DOMAIN_CLOCK_BASIS_UTC = 0, + VIR_DOMAIN_CLOCK_BASIS_LOCALTIME = 1, + + VIR_DOMAIN_CLOCK_BASIS_LAST, +}; + typedef struct _virDomainClockDef virDomainClockDef; typedef virDomainClockDef *virDomainClockDefPtr; struct _virDomainClockDef { int offset; union { - /* Adjustment in seconds, relative to UTC, when + /* Adjustment in seconds, relative to UTC or LOCALTIME, when * offset == VIR_DOMAIN_CLOCK_OFFSET_VARIABLE */ - long long adjustment; + struct { + long long adjustment; + int basis; + } variable; /* Timezone name, when * offset == VIR_DOMAIN_CLOCK_OFFSET_LOCALTIME */ @@ -2069,6 +2079,7 @@ int virDomainStateReasonFromString(virDomainState state, const char *reason); VIR_ENUM_DECL(virDomainSeclabel) VIR_ENUM_DECL(virDomainClockOffset) +VIR_ENUM_DECL(virDomainClockBasis) VIR_ENUM_DECL(virDomainTimerName) VIR_ENUM_DECL(virDomainTimerTrack) diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index d6ad36c..f850742 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -258,6 +258,7 @@ virDomainChrTcpProtocolTypeFromString; virDomainChrTcpProtocolTypeToString; virDomainChrTypeFromString; virDomainChrTypeToString; +virDomainClockBasisTypeToString; virDomainClockOffsetTypeFromString; virDomainClockOffsetTypeToString; virDomainConfigFile; diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 0e26df1..3f0c3c1 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -3430,7 +3430,13 @@ qemuBuildClockArgStr(virDomainClockDefPtr def) time_t now = time(NULL); struct tm nowbits; - now += def->data.adjustment; + if (def->data.variable.basis != VIR_DOMAIN_CLOCK_BASIS_UTC) { + qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("unsupported clock basis '%s'"), + virDomainClockBasisTypeToString(def->data.variable.basis)); + goto error; + } + now += def->data.variable.adjustment; gmtime_r(&now, &nowbits); virBufferAsprintf(&buf, "base=%d-%02d-%02dT%02d:%02d:%02d", diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 2d92d66..2f6f068 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -734,7 +734,7 @@ qemuProcessHandleRTCChange(qemuMonitorPtr mon ATTRIBUTE_UNUSED, event = virDomainEventRTCChangeNewFromObj(vm, offset); if (vm->def->clock.offset == VIR_DOMAIN_CLOCK_OFFSET_VARIABLE) - vm->def->clock.data.adjustment = offset; + vm->def->clock.data.variable.adjustment = offset; if (virDomainSaveStatus(driver->caps, driver->stateDir, vm) < 0) VIR_WARN("unable to save domain status with RTC change"); diff --git a/tests/qemuxml2argvdata/qemuxml2argv-clock-variable.xml b/tests/qemuxml2argvdata/qemuxml2argv-clock-variable.xml index 9f52cca..eadefac 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-clock-variable.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-clock-variable.xml @@ -8,7 +8,7 @@ <type arch='i686' machine='pc'>hvm</type> <boot dev='hd'/> </os> - <clock offset='variable' adjustment='123456'/> + <clock offset='variable' adjustment='123456' basis='utc'/> <on_poweroff>destroy</on_poweroff> <on_reboot>restart</on_reboot> <on_crash>destroy</on_crash> -- 1.7.1

XenD-3.1 introduced managed domains. HV-domains have rtc_timeoffset (hgd24f37b31030 from 2007-04-03), which tracks the offset between the hypervisors clock and the domains RTC, and is persisted by XenD. In combination with localtime=1 this had a bug until XenD-3.4 (hg5d701be7c37b from 2009-04-01) (I'm not 100% sure how that bug manifests, but at least for me in TZ=Europe/Berlin I see the previous offset relative to utc being applied to localtime again, which manifests in an extra hour being added) XenD implements the following variants for clock/@offset: - PV domains don't have a RTC → 'localtime' | 'utc' - <3.1: no managed domains → 'localtime' | 'utc' - ≥3.1: the offset is tracked for HV → 'variable' due to the localtime=1 bug → 'localtime' | 'utc' - ≥3.4: the offset is tracked for HV → 'variable' Current libvirtd still thinks XenD only implements <clock offset='utc'/> and <clock offset='localtime'/>, which is wrong, since the semantic of 'utc' and 'localtime' specifies, that the offset will be reset on domain-restart, while with 'variable' the offset is kept. (keeping the offset over "virsh edit" is important, since otherwise the clock might jump, which confuses certain guest OSs) xendConfigVersion was last incremented to 4 by the xen-folks for xen-3.1.0. I know of no way to reliably detect the version of XenD (user space tools), which may be different from the version of the hypervisor (kernel) version! Because of this only the change from 'utc'/'localtime' to 'variable' in XenD-3.1 is handled, not the buggy behaviour of XenD-3.1 until XenD-3.4. For backward compatibility with previous versions of libvirt Xen-HV still accepts 'utc' and 'localtime', but they are returned as 'variable' on the next read-back from Xend to libvirt, since this is what XenD implements: The RTC is NOT reset back to the specified time on next restart, but the previous offset is kept. Signed-off-by: Philipp Hahn <hahn@univention.de> --- src/xenxs/xen_sxpr.c | 161 +++++++++++++++++++++++++++++++++++++------------ src/xenxs/xen_xm.c | 116 ++++++++++++++++++++++++++++-------- 2 files changed, 212 insertions(+), 65 deletions(-) diff --git a/src/xenxs/xen_sxpr.c b/src/xenxs/xen_sxpr.c index f8390ea..2d6cddb 100644 --- a/src/xenxs/xen_sxpr.c +++ b/src/xenxs/xen_sxpr.c @@ -1126,7 +1126,7 @@ xenParseSxpr(const struct sexpr *root, { const char *tmp; virDomainDefPtr def; - int hvm = 0; + int hvm = 0, vmlocaltime; if (VIR_ALLOC(def) < 0) goto no_memory; @@ -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); @@ -1259,10 +1258,29 @@ xenParseSxpr(const struct sexpr *root, def->features |= (1 << VIR_DOMAIN_FEATURE_HAP); 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; + /* 12aaf4a2486b (3.0.3) added a second low-priority 'localtime' setting */ + vmlocaltime = sexpr_int(root, "domain/localtime"); + if (hvm) { + const char *value = sexpr_node(root, "domain/image/hvm/localtime"); + if (value) + vmlocaltime = strtol(value, NULL, 0); + /* only managed HVM domains since 3.1.0 have persistent rtc_timeoffset */ + if (xendConfigVersion < XEND_CONFIG_VERSION_3_1_0) { + if (vmlocaltime) + def->clock.offset = VIR_DOMAIN_CLOCK_OFFSET_LOCALTIME; + else + def->clock.offset = VIR_DOMAIN_CLOCK_OFFSET_UTC; + } else { + int rtc_offset; + def->clock.offset = VIR_DOMAIN_CLOCK_OFFSET_VARIABLE; + rtc_offset = sexpr_int(root, "domain/image/hvm/rtc_timeoffset"); + def->clock.data.variable.adjustment = rtc_offset; + def->clock.data.variable.basis = vmlocaltime ? + VIR_DOMAIN_CLOCK_BASIS_LOCALTIME : + VIR_DOMAIN_CLOCK_BASIS_UTC; + } if (sexpr_lookup(root, "domain/image/hvm/hpet")) { virDomainTimerDefPtr timer; @@ -1280,14 +1298,16 @@ xenParseSxpr(const struct sexpr *root, def->clock.ntimers = 1; def->clock.timers[0] = timer; } - } else { /* !hvm */ - if (sexpr_int(root, "domain/image/linux/localtime")) + } else { + const char *value = sexpr_node(root, "domain/image/linux/localtime"); + if (value) + vmlocaltime = strtol(value, NULL, 0); + /* PV domains do not have an emulated RTC and the offset is fixed. */ + if (vmlocaltime) 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; + else + def->clock.offset = VIR_DOMAIN_CLOCK_OFFSET_UTC; + } /* !hvm */ if (sexpr_node_copy(root, hvm ? "domain/image/hvm/device_model" : @@ -2195,7 +2215,8 @@ xenFormatSxpr(virConnectPtr conn, char uuidstr[VIR_UUID_STRING_BUFLEN]; const char *tmp; char *bufout; - int hvm = 0, i; + int hvm = 0, i, vmlocaltime = -1; + bool in_image = false; VIR_DEBUG("Formatting domain sexpr"); @@ -2255,30 +2276,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; - } - - 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 (STREQ(def->os.type, "hvm")) + hvm = 1; if (!def->os.bootloader) { - if (STREQ(def->os.type, "hvm")) - hvm = 1; - if (hvm) virBufferAddLit(&buf, "(image (hvm "); else virBufferAddLit(&buf, "(image (linux "); + in_image = true; if (hvm && def->os.loader == NULL) { @@ -2424,17 +2430,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 >= XEND_CONFIG_VERSION_3_0_4)) @@ -2458,15 +2460,94 @@ 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, "(image (linux (args '%s')", def->os.cmdline); + in_image = true; + } + } /* os.bootloader */ + + + if (xendConfigVersion < XEND_CONFIG_VERSION_3_1_0) { + /* <3.1: UTC and LOCALTIME */ + switch (def->clock.offset) { + case VIR_DOMAIN_CLOCK_OFFSET_UTC: + vmlocaltime = 0; + break; + case VIR_DOMAIN_CLOCK_OFFSET_LOCALTIME: + vmlocaltime = 1; + break; + default: + vmlocaltime = -1; /* goto clock_error */ } + } else { + if (!in_image) { + if (hvm) + virBufferAddLit(&buf, "(image (hvm "); + else + virBufferAddLit(&buf, "(image (linux "); + in_image = true; + } + if (hvm) { + /* >=3.1 HV: VARIABLE */ + int rtc_timeoffset; + switch (def->clock.offset) { + case VIR_DOMAIN_CLOCK_OFFSET_VARIABLE: + vmlocaltime = (int)def->clock.data.variable.basis; + rtc_timeoffset = def->clock.data.variable.adjustment; + break; +/* Previously libvirt ≤0.9.9 returned UTC and LOCALTIME while XenD ≥3.1 + * (d24f37b31030 from 2007-04-03) really implemented VARIABLE. + * For backward compatibility (snapshots!) old XML is silently accepted and + * converted. If the behaviour to reset the offset back to 0 on restart is + * important and an error is preferred, define STRICT. */ +#ifndef LIBVIRT_XEND_CLOCK_STRICT + case VIR_DOMAIN_CLOCK_OFFSET_UTC: + vmlocaltime = 0; + rtc_timeoffset = 0; + break; + case VIR_DOMAIN_CLOCK_OFFSET_LOCALTIME: + vmlocaltime = 1; + rtc_timeoffset = 0; + break; +#endif + default: + vmlocaltime = -1; /* goto clock_error */ + } + if (vmlocaltime >= 0) + virBufferAsprintf(&buf, "(rtc_timeoffset %d)", rtc_timeoffset); + } else { + /* >=3.1 PV: UTC and LOCALTIME */ + switch (def->clock.offset) { + case VIR_DOMAIN_CLOCK_OFFSET_UTC: + vmlocaltime = 0; + break; + case VIR_DOMAIN_CLOCK_OFFSET_LOCALTIME: + vmlocaltime = 1; + break; + default: + vmlocaltime = -1; /* goto clock_error */ + } + } /* !hvm */ + /* default post-XenD-3.1 location: */ + if (vmlocaltime >= 0) + virBufferAsprintf(&buf, "(localtime %d)", vmlocaltime); } + if (vmlocaltime < 0) { /* clock_error: */ + XENXS_ERROR(VIR_ERR_CONFIG_UNSUPPORTED, + _("unsupported clock offset '%s'"), + virDomainClockOffsetTypeToString(def->clock.offset)); + goto error; + } + if (in_image) { + /* closes (image(hvm|linux */ + virBufferAddLit(&buf, "))"); + in_image = false; + } + /* pre-XenD-3.1 and compatibility location */ + virBufferAsprintf(&buf, "(localtime %d)", vmlocaltime); + 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 e580a3e..15190de 100644 --- a/src/xenxs/xen_xm.c +++ b/src/xenxs/xen_xm.c @@ -414,9 +414,29 @@ 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) { + /* only managed HVM domains since 3.1.0 have persistent rtc_timeoffset */ + if (xendConfigVersion < XEND_CONFIG_VERSION_3_1_0) { + if (vmlocaltime) + def->clock.offset = VIR_DOMAIN_CLOCK_OFFSET_LOCALTIME; + else + def->clock.offset = VIR_DOMAIN_CLOCK_OFFSET_UTC; + } else { + unsigned long rtc_timeoffset; + def->clock.offset = VIR_DOMAIN_CLOCK_OFFSET_VARIABLE; + if (xenXMConfigGetULong(conf, "rtc_timeoffset", &rtc_timeoffset, 0) < 0) + goto cleanup; + def->clock.data.variable.adjustment = (int)rtc_timeoffset; + def->clock.data.variable.basis = vmlocaltime ? + VIR_DOMAIN_CLOCK_BASIS_LOCALTIME : + VIR_DOMAIN_CLOCK_BASIS_UTC; + } + } else { + /* PV domains do not have an emulated RTC and the offset is fixed. */ + 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; @@ -1450,7 +1470,7 @@ virConfPtr xenFormatXM(virConnectPtr conn, virDomainDefPtr def, int xendConfigVersion) { virConfPtr conf = NULL; - int hvm = 0, i; + int hvm = 0, i, vmlocaltime = 0; char *cpus = NULL; const char *lifecycle; char uuid[VIR_UUID_STRING_BUFLEN]; @@ -1557,26 +1577,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,8 +1615,74 @@ virConfPtr xenFormatXM(virConnectPtr conn, if (def->os.cmdline && xenXMConfigSetString(conf, "extra", def->os.cmdline) < 0) goto no_memory; - + } /* !hvm */ + + + if (xendConfigVersion < XEND_CONFIG_VERSION_3_1_0) { + /* <3.1: UTC and LOCALTIME */ + switch (def->clock.offset) { + case VIR_DOMAIN_CLOCK_OFFSET_UTC: + vmlocaltime = 0; + break; + case VIR_DOMAIN_CLOCK_OFFSET_LOCALTIME: + vmlocaltime = 1; + break; + default: + vmlocaltime = -1; /* goto clock_error */ + } + } else { + if (hvm) { + /* >=3.1 HV: VARIABLE */ + int rtc_timeoffset; + switch (def->clock.offset) { + case VIR_DOMAIN_CLOCK_OFFSET_VARIABLE: + vmlocaltime = (int)def->clock.data.variable.basis; + rtc_timeoffset = def->clock.data.variable.adjustment; + break; +/* Previously libvirt ≤0.9.9 returned UTC and LOCALTIME while XenD ≥3.1 + * (d24f37b31030 from 2007-04-03) really implemented VARIABLE. + * For backward compatibility (snapshots!) old XML is silently accepted and + * converted. If the behaviour to reset the offset back to 0 on restart is + * important and an error is preferred, define STRICT. */ +#ifndef LIBVIRT_XEND_CLOCK_STRICT + case VIR_DOMAIN_CLOCK_OFFSET_UTC: + vmlocaltime = 0; + rtc_timeoffset = 0; + break; + case VIR_DOMAIN_CLOCK_OFFSET_LOCALTIME: + vmlocaltime = 1; + rtc_timeoffset = 0; + break; +#endif + default: + vmlocaltime = -1; /* goto clock_error */ + } + if (vmlocaltime >= 0) + if (xenXMConfigSetInt(conf, "rtc_timeoffset", rtc_timeoffset) < 0) + goto no_memory; + } else { + /* >=3.1 PV: UTC and LOCALTIME */ + switch (def->clock.offset) { + case VIR_DOMAIN_CLOCK_OFFSET_UTC: + vmlocaltime = 0; + break; + case VIR_DOMAIN_CLOCK_OFFSET_LOCALTIME: + vmlocaltime = 1; + break; + default: + vmlocaltime = -1; /* goto clock_error */ + } + } /* !hvm */ + } + if (vmlocaltime < 0) { /* clock_error: */ + 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 (!(lifecycle = virDomainLifecycleTypeToString(def->onPoweroff))) { XENXS_ERROR(VIR_ERR_INTERNAL_ERROR, -- 1.7.1

"localtime = 0" is always inserted, because otherwise on updates the value is not changed within XenD. Some statements change their order becaus code was moved around. Signed-off-by: Philipp Hahn <hahn@univention.de> --- tests/xmconfigdata/sexpr2xml-pv-bootloader.cfg | 1 + tests/xmconfigdata/test-fullvirt-force-hpet.cfg | 2 +- tests/xmconfigdata/test-fullvirt-force-nohpet.cfg | 2 +- tests/xmconfigdata/test-fullvirt-old-cdrom.cfg | 2 +- tests/xmconfigdata/test-paravirt-net-e1000.cfg | 1 + tests/xmconfigdata/test-paravirt-net-vifname.cfg | 1 + .../test-paravirt-new-pvfb-vncdisplay.cfg | 1 + tests/xmconfigdata/test-paravirt-new-pvfb.cfg | 1 + .../test-paravirt-old-pvfb-vncdisplay.cfg | 1 + tests/xmconfigdata/test-paravirt-old-pvfb.cfg | 1 + tests/xmconfigdata/test-paravirt-vcpu.cfg | 1 + tests/xml2sexprdata/xml2sexpr-boot-grub.sexpr | 1 + tests/xml2sexprdata/xml2sexpr-bridge-ipaddr.sexpr | 4 +++- tests/xml2sexprdata/xml2sexpr-curmem.sexpr | 1 + .../xml2sexpr-disk-block-shareable.sexpr | 4 +++- tests/xml2sexprdata/xml2sexpr-disk-block.sexpr | 4 +++- .../xml2sexprdata/xml2sexpr-disk-drv-blkback.sexpr | 4 +++- .../xml2sexpr-disk-drv-blktap-qcow.sexpr | 4 +++- .../xml2sexpr-disk-drv-blktap-raw.sexpr | 4 +++- .../xml2sexprdata/xml2sexpr-disk-drv-blktap.sexpr | 4 +++- .../xml2sexpr-disk-drv-blktap2-raw.sexpr | 4 +++- .../xml2sexprdata/xml2sexpr-disk-drv-blktap2.sexpr | 4 +++- tests/xml2sexprdata/xml2sexpr-disk-drv-loop.sexpr | 4 +++- tests/xml2sexprdata/xml2sexpr-disk-file.sexpr | 4 +++- tests/xml2sexprdata/xml2sexpr-escape.sexpr | 1 + tests/xml2sexprdata/xml2sexpr-fv-force-hpet.sexpr | 1 + .../xml2sexprdata/xml2sexpr-fv-force-nohpet.sexpr | 1 + tests/xml2sexprdata/xml2sexpr-fv-kernel.sexpr | 1 + tests/xml2sexprdata/xml2sexpr-fv-localtime.sexpr | 5 +++-- tests/xml2sexprdata/xml2sexpr-fv-net-ioemu.sexpr | 3 ++- .../xml2sexprdata/xml2sexpr-fv-net-netfront.sexpr | 3 ++- .../xml2sexprdata/xml2sexpr-fv-parallel-tcp.sexpr | 1 + .../xml2sexpr-fv-serial-dev-2-ports.sexpr | 3 ++- .../xml2sexpr-fv-serial-dev-2nd-port.sexpr | 1 + tests/xml2sexprdata/xml2sexpr-fv-serial-file.sexpr | 3 ++- tests/xml2sexprdata/xml2sexpr-fv-serial-null.sexpr | 1 + tests/xml2sexprdata/xml2sexpr-fv-serial-pipe.sexpr | 3 ++- tests/xml2sexprdata/xml2sexpr-fv-serial-pty.sexpr | 1 + .../xml2sexprdata/xml2sexpr-fv-serial-stdio.sexpr | 1 + .../xml2sexpr-fv-serial-tcp-telnet.sexpr | 1 + tests/xml2sexprdata/xml2sexpr-fv-serial-tcp.sexpr | 1 + tests/xml2sexprdata/xml2sexpr-fv-serial-udp.sexpr | 1 + tests/xml2sexprdata/xml2sexpr-fv-serial-unix.sexpr | 1 + tests/xml2sexprdata/xml2sexpr-fv-sound.sexpr | 1 + tests/xml2sexprdata/xml2sexpr-fv-usbmouse.sexpr | 1 + tests/xml2sexprdata/xml2sexpr-fv-usbtablet.sexpr | 3 ++- tests/xml2sexprdata/xml2sexpr-fv-utc.sexpr | 1 + tests/xml2sexprdata/xml2sexpr-fv-v2.sexpr | 1 + tests/xml2sexprdata/xml2sexpr-fv-vncunused.sexpr | 3 ++- tests/xml2sexprdata/xml2sexpr-fv.sexpr | 1 + tests/xml2sexprdata/xml2sexpr-net-bridged.sexpr | 2 +- tests/xml2sexprdata/xml2sexpr-net-e1000.sexpr | 2 +- tests/xml2sexprdata/xml2sexpr-net-routed.sexpr | 2 +- .../xml2sexprdata/xml2sexpr-no-source-cdrom.sexpr | 1 + tests/xml2sexprdata/xml2sexpr-pci-devs.sexpr | 2 +- .../xml2sexpr-pv-bootloader-cmdline.sexpr | 1 + tests/xml2sexprdata/xml2sexpr-pv-bootloader.sexpr | 4 +++- tests/xml2sexprdata/xml2sexpr-pv-vcpus.sexpr | 2 +- .../xml2sexprdata/xml2sexpr-pv-vfb-new-auto.sexpr | 2 +- tests/xml2sexprdata/xml2sexpr-pv-vfb-new.sexpr | 2 +- tests/xml2sexprdata/xml2sexpr-pv-vfb-orig.sexpr | 1 + tests/xml2sexprdata/xml2sexpr-pv.sexpr | 2 +- 62 files changed, 95 insertions(+), 32 deletions(-) diff --git a/tests/xmconfigdata/sexpr2xml-pv-bootloader.cfg b/tests/xmconfigdata/sexpr2xml-pv-bootloader.cfg index b8570f2..c9abadd 100644 --- a/tests/xmconfigdata/sexpr2xml-pv-bootloader.cfg +++ b/tests/xmconfigdata/sexpr2xml-pv-bootloader.cfg @@ -5,6 +5,7 @@ memory = 420 vcpus = 2 bootloader = "/usr/bin/pypxeboot" bootargs = "mac=AA:00:86:e2:35:72" +localtime = 0 on_poweroff = "destroy" on_reboot = "destroy" on_crash = "destroy" diff --git a/tests/xmconfigdata/test-fullvirt-force-hpet.cfg b/tests/xmconfigdata/test-fullvirt-force-hpet.cfg index 4dd7585..178aecd 100644 --- a/tests/xmconfigdata/test-fullvirt-force-hpet.cfg +++ b/tests/xmconfigdata/test-fullvirt-force-hpet.cfg @@ -9,8 +9,8 @@ boot = "d" pae = 1 acpi = 1 apic = 1 -localtime = 0 hpet = 1 +localtime = 0 on_poweroff = "destroy" on_reboot = "restart" on_crash = "restart" diff --git a/tests/xmconfigdata/test-fullvirt-force-nohpet.cfg b/tests/xmconfigdata/test-fullvirt-force-nohpet.cfg index d4fb429..44f5ac7 100644 --- a/tests/xmconfigdata/test-fullvirt-force-nohpet.cfg +++ b/tests/xmconfigdata/test-fullvirt-force-nohpet.cfg @@ -9,8 +9,8 @@ boot = "d" pae = 1 acpi = 1 apic = 1 -localtime = 0 hpet = 0 +localtime = 0 on_poweroff = "destroy" on_reboot = "restart" on_crash = "restart" diff --git a/tests/xmconfigdata/test-fullvirt-old-cdrom.cfg b/tests/xmconfigdata/test-fullvirt-old-cdrom.cfg index 4ec862c..5d2ab81 100755 --- a/tests/xmconfigdata/test-fullvirt-old-cdrom.cfg +++ b/tests/xmconfigdata/test-fullvirt-old-cdrom.cfg @@ -9,8 +9,8 @@ boot = "d" pae = 1 acpi = 1 apic = 1 -localtime = 0 cdrom = "/root/boot.iso" +localtime = 0 on_poweroff = "destroy" on_reboot = "restart" on_crash = "restart" diff --git a/tests/xmconfigdata/test-paravirt-net-e1000.cfg b/tests/xmconfigdata/test-paravirt-net-e1000.cfg index 591f2ab..bcc16fb 100755 --- a/tests/xmconfigdata/test-paravirt-net-e1000.cfg +++ b/tests/xmconfigdata/test-paravirt-net-e1000.cfg @@ -4,6 +4,7 @@ maxmem = 579 memory = 394 vcpus = 1 bootloader = "/usr/bin/pygrub" +localtime = 0 on_poweroff = "destroy" on_reboot = "restart" on_crash = "restart" diff --git a/tests/xmconfigdata/test-paravirt-net-vifname.cfg b/tests/xmconfigdata/test-paravirt-net-vifname.cfg index 3d685ca..98ce75b 100644 --- a/tests/xmconfigdata/test-paravirt-net-vifname.cfg +++ b/tests/xmconfigdata/test-paravirt-net-vifname.cfg @@ -4,6 +4,7 @@ maxmem = 579 memory = 394 vcpus = 1 bootloader = "/usr/bin/pygrub" +localtime = 0 on_poweroff = "destroy" on_reboot = "restart" on_crash = "restart" diff --git a/tests/xmconfigdata/test-paravirt-new-pvfb-vncdisplay.cfg b/tests/xmconfigdata/test-paravirt-new-pvfb-vncdisplay.cfg index 881ed2b..633552c 100644 --- a/tests/xmconfigdata/test-paravirt-new-pvfb-vncdisplay.cfg +++ b/tests/xmconfigdata/test-paravirt-new-pvfb-vncdisplay.cfg @@ -4,6 +4,7 @@ maxmem = 579 memory = 394 vcpus = 1 bootloader = "/usr/bin/pygrub" +localtime = 0 on_poweroff = "destroy" on_reboot = "restart" on_crash = "restart" diff --git a/tests/xmconfigdata/test-paravirt-new-pvfb.cfg b/tests/xmconfigdata/test-paravirt-new-pvfb.cfg index 8f5e9aa..8b56e19 100755 --- a/tests/xmconfigdata/test-paravirt-new-pvfb.cfg +++ b/tests/xmconfigdata/test-paravirt-new-pvfb.cfg @@ -4,6 +4,7 @@ maxmem = 579 memory = 394 vcpus = 1 bootloader = "/usr/bin/pygrub" +localtime = 0 on_poweroff = "destroy" on_reboot = "restart" on_crash = "restart" diff --git a/tests/xmconfigdata/test-paravirt-old-pvfb-vncdisplay.cfg b/tests/xmconfigdata/test-paravirt-old-pvfb-vncdisplay.cfg index 15134ea..eea3365 100644 --- a/tests/xmconfigdata/test-paravirt-old-pvfb-vncdisplay.cfg +++ b/tests/xmconfigdata/test-paravirt-old-pvfb-vncdisplay.cfg @@ -4,6 +4,7 @@ maxmem = 579 memory = 394 vcpus = 1 bootloader = "/usr/bin/pygrub" +localtime = 0 on_poweroff = "destroy" on_reboot = "restart" on_crash = "restart" diff --git a/tests/xmconfigdata/test-paravirt-old-pvfb.cfg b/tests/xmconfigdata/test-paravirt-old-pvfb.cfg index b190294..ed9c771 100755 --- a/tests/xmconfigdata/test-paravirt-old-pvfb.cfg +++ b/tests/xmconfigdata/test-paravirt-old-pvfb.cfg @@ -4,6 +4,7 @@ maxmem = 579 memory = 394 vcpus = 1 bootloader = "/usr/bin/pygrub" +localtime = 0 on_poweroff = "destroy" on_reboot = "restart" on_crash = "restart" diff --git a/tests/xmconfigdata/test-paravirt-vcpu.cfg b/tests/xmconfigdata/test-paravirt-vcpu.cfg index d0844f5..2ac0f79 100644 --- a/tests/xmconfigdata/test-paravirt-vcpu.cfg +++ b/tests/xmconfigdata/test-paravirt-vcpu.cfg @@ -5,6 +5,7 @@ memory = 394 vcpus = 4 vcpu_avail = 3 bootloader = "/usr/bin/pygrub" +localtime = 0 on_poweroff = "destroy" on_reboot = "restart" on_crash = "restart" diff --git a/tests/xml2sexprdata/xml2sexpr-boot-grub.sexpr b/tests/xml2sexprdata/xml2sexpr-boot-grub.sexpr index 88c0f68..4850bc0 100644 --- a/tests/xml2sexprdata/xml2sexpr-boot-grub.sexpr +++ b/tests/xml2sexprdata/xml2sexpr-boot-grub.sexpr @@ -2,4 +2,5 @@ (uuid '596a5d21-71f4-8fb2-e068-e2386a5c413e')(on_poweroff 'destroy')\ (on_reboot 'destroy')(on_crash 'destroy')(image (linux \ (kernel '/usr/lib/xen/boot/pv-grub-x86_64.gz')(args '(hd0,0)/grub/menu.lst')))\ +(localtime 0)\ (device (vbd (dev 'xvda')(uname 'phy:/dev/MainVG/GuestLV')(mode 'w'))))\ diff --git a/tests/xml2sexprdata/xml2sexpr-bridge-ipaddr.sexpr b/tests/xml2sexprdata/xml2sexpr-bridge-ipaddr.sexpr index 56ff525..47c4a3e 100644 --- a/tests/xml2sexprdata/xml2sexpr-bridge-ipaddr.sexpr +++ b/tests/xml2sexprdata/xml2sexpr-bridge-ipaddr.sexpr @@ -4,7 +4,9 @@ (kernel '/var/lib/xen/vmlinuz.2Dn2YT')\ (ramdisk '/var/lib/xen/initrd.img.0u-Vhq')\ (args ' method=http://download.fedora.devel.redhat.com/pub/fedora/linux/\ -core/test/5.91/x86_64/os ')))(device (vbd (dev 'xvda')\ +core/test/5.91/x86_64/os ')))\ +(localtime 0)\ +(device (vbd (dev 'xvda')\ (uname 'file:/root/some.img')(mode 'w')))\ (device (vif (mac '00:11:22:33:44:55')(bridge 'xenbr2')\ (script 'vif-bridge')(ip '192.0.2.1'))))\ diff --git a/tests/xml2sexprdata/xml2sexpr-curmem.sexpr b/tests/xml2sexprdata/xml2sexpr-curmem.sexpr index e7149b3..89d48b2 100644 --- a/tests/xml2sexprdata/xml2sexpr-curmem.sexpr +++ b/tests/xml2sexprdata/xml2sexpr-curmem.sexpr @@ -1,6 +1,7 @@ (vm (name 'rhel5')(memory 175)(maxmem 385)(vcpus 1)\ (uuid '4f77abd2-3019-58e8-3bab-6fbf2118f880')(bootloader '/usr/bin/pygrub')\ (on_poweroff 'destroy')(on_reboot 'restart')(on_crash 'restart')\ +(localtime 0)\ (device (tap (dev 'xvda')(uname 'tap:aio:/xen/rhel5.img')(mode 'w')))\ (device (vif (mac '00:16:3e:1d:06:15')(bridge 'xenbr0')\ (script 'vif-bridge'))))\ diff --git a/tests/xml2sexprdata/xml2sexpr-disk-block-shareable.sexpr b/tests/xml2sexprdata/xml2sexpr-disk-block-shareable.sexpr index b8387e5..dd03f7b 100644 --- a/tests/xml2sexprdata/xml2sexpr-disk-block-shareable.sexpr +++ b/tests/xml2sexprdata/xml2sexpr-disk-block-shareable.sexpr @@ -2,6 +2,8 @@ (uuid '49a0c6ff-c066-5392-6498-3632d093c2e7')(bootloader '/usr/bin/pygrub')\ (on_poweroff 'destroy')(on_reboot 'restart')(on_crash 'restart')\ (image (linux (args 'ro root=/dev/VolGroup00/LogVol00')))\ +(localtime 0)\ (device (tap (dev 'xvda')(uname 'tap:aio:/var/lib/xen/images/rhel5pv.img')\ -(mode 'w!')))(device (vif (mac '00:16:3e:23:9e:eb')(bridge 'xenbr0')\ +(mode 'w!')))\ +(device (vif (mac '00:16:3e:23:9e:eb')(bridge 'xenbr0')\ (script 'vif-bridge'))))\ diff --git a/tests/xml2sexprdata/xml2sexpr-disk-block.sexpr b/tests/xml2sexprdata/xml2sexpr-disk-block.sexpr index 960801a..b04c618 100644 --- a/tests/xml2sexprdata/xml2sexpr-disk-block.sexpr +++ b/tests/xml2sexprdata/xml2sexpr-disk-block.sexpr @@ -4,5 +4,7 @@ (image (linux (kernel '/var/lib/xen/vmlinuz.2Dn2YT')\ (ramdisk '/var/lib/xen/initrd.img.0u-Vhq')\ (args ' method=http://download.fedora.devel.redhat.com/pub/fedora/linux/\ -core/test/5.91/x86_64/os ')))(device (vbd (dev 'xvda')\ +core/test/5.91/x86_64/os ')))\ +(localtime 0)\ +(device (vbd (dev 'xvda')\ (uname 'phy:/dev/MainVG/GuestLV')(mode 'w'))))\ diff --git a/tests/xml2sexprdata/xml2sexpr-disk-drv-blkback.sexpr b/tests/xml2sexprdata/xml2sexpr-disk-drv-blkback.sexpr index 960801a..b04c618 100644 --- a/tests/xml2sexprdata/xml2sexpr-disk-drv-blkback.sexpr +++ b/tests/xml2sexprdata/xml2sexpr-disk-drv-blkback.sexpr @@ -4,5 +4,7 @@ (image (linux (kernel '/var/lib/xen/vmlinuz.2Dn2YT')\ (ramdisk '/var/lib/xen/initrd.img.0u-Vhq')\ (args ' method=http://download.fedora.devel.redhat.com/pub/fedora/linux/\ -core/test/5.91/x86_64/os ')))(device (vbd (dev 'xvda')\ +core/test/5.91/x86_64/os ')))\ +(localtime 0)\ +(device (vbd (dev 'xvda')\ (uname 'phy:/dev/MainVG/GuestLV')(mode 'w'))))\ diff --git a/tests/xml2sexprdata/xml2sexpr-disk-drv-blktap-qcow.sexpr b/tests/xml2sexprdata/xml2sexpr-disk-drv-blktap-qcow.sexpr index 1e1b381..6341d04 100644 --- a/tests/xml2sexprdata/xml2sexpr-disk-drv-blktap-qcow.sexpr +++ b/tests/xml2sexprdata/xml2sexpr-disk-drv-blktap-qcow.sexpr @@ -4,5 +4,7 @@ (image (linux (kernel '/var/lib/xen/vmlinuz.2Dn2YT')\ (ramdisk '/var/lib/xen/initrd.img.0u-Vhq')\ (args ' method=http://download.fedora.devel.redhat.com/pub/fedora/linux/\ -core/test/5.91/x86_64/os ')))(device (tap (dev 'xvda')\ +core/test/5.91/x86_64/os ')))\ +(localtime 0)\ +(device (tap (dev 'xvda')\ (uname 'tap:qcow:/root/some.img')(mode 'w'))))\ diff --git a/tests/xml2sexprdata/xml2sexpr-disk-drv-blktap-raw.sexpr b/tests/xml2sexprdata/xml2sexpr-disk-drv-blktap-raw.sexpr index 6b66e43..6a6a43a 100644 --- a/tests/xml2sexprdata/xml2sexpr-disk-drv-blktap-raw.sexpr +++ b/tests/xml2sexprdata/xml2sexpr-disk-drv-blktap-raw.sexpr @@ -4,5 +4,7 @@ (image (linux (kernel '/var/lib/xen/vmlinuz.2Dn2YT')\ (ramdisk '/var/lib/xen/initrd.img.0u-Vhq')\ (args ' method=http://download.fedora.devel.redhat.com/pub/fedora/linux/\ -core/test/5.91/x86_64/os ')))(device (tap (dev 'xvda')\ +core/test/5.91/x86_64/os ')))\ +(localtime 0)\ +(device (tap (dev 'xvda')\ (uname 'tap:aio:/root/some.img')(mode 'w'))))\ diff --git a/tests/xml2sexprdata/xml2sexpr-disk-drv-blktap.sexpr b/tests/xml2sexprdata/xml2sexpr-disk-drv-blktap.sexpr index 6b66e43..6a6a43a 100644 --- a/tests/xml2sexprdata/xml2sexpr-disk-drv-blktap.sexpr +++ b/tests/xml2sexprdata/xml2sexpr-disk-drv-blktap.sexpr @@ -4,5 +4,7 @@ (image (linux (kernel '/var/lib/xen/vmlinuz.2Dn2YT')\ (ramdisk '/var/lib/xen/initrd.img.0u-Vhq')\ (args ' method=http://download.fedora.devel.redhat.com/pub/fedora/linux/\ -core/test/5.91/x86_64/os ')))(device (tap (dev 'xvda')\ +core/test/5.91/x86_64/os ')))\ +(localtime 0)\ +(device (tap (dev 'xvda')\ (uname 'tap:aio:/root/some.img')(mode 'w'))))\ diff --git a/tests/xml2sexprdata/xml2sexpr-disk-drv-blktap2-raw.sexpr b/tests/xml2sexprdata/xml2sexpr-disk-drv-blktap2-raw.sexpr index 1e79bcf..b1caabb 100644 --- a/tests/xml2sexprdata/xml2sexpr-disk-drv-blktap2-raw.sexpr +++ b/tests/xml2sexprdata/xml2sexpr-disk-drv-blktap2-raw.sexpr @@ -4,5 +4,7 @@ (image (linux (kernel '/var/lib/xen/vmlinuz.2Dn2YT')\ (ramdisk '/var/lib/xen/initrd.img.0u-Vhq')\ (args ' method=http://download.fedora.devel.redhat.com/pub/fedora/linux/\ -core/test/5.91/x86_64/os ')))(device (tap2 (dev 'xvda')\ +core/test/5.91/x86_64/os ')))\ +(localtime 0)\ +(device (tap2 (dev 'xvda')\ (uname 'tap2:aio:/root/some.img')(mode 'w'))))\ diff --git a/tests/xml2sexprdata/xml2sexpr-disk-drv-blktap2.sexpr b/tests/xml2sexprdata/xml2sexpr-disk-drv-blktap2.sexpr index 1e79bcf..b1caabb 100644 --- a/tests/xml2sexprdata/xml2sexpr-disk-drv-blktap2.sexpr +++ b/tests/xml2sexprdata/xml2sexpr-disk-drv-blktap2.sexpr @@ -4,5 +4,7 @@ (image (linux (kernel '/var/lib/xen/vmlinuz.2Dn2YT')\ (ramdisk '/var/lib/xen/initrd.img.0u-Vhq')\ (args ' method=http://download.fedora.devel.redhat.com/pub/fedora/linux/\ -core/test/5.91/x86_64/os ')))(device (tap2 (dev 'xvda')\ +core/test/5.91/x86_64/os ')))\ +(localtime 0)\ +(device (tap2 (dev 'xvda')\ (uname 'tap2:aio:/root/some.img')(mode 'w'))))\ diff --git a/tests/xml2sexprdata/xml2sexpr-disk-drv-loop.sexpr b/tests/xml2sexprdata/xml2sexpr-disk-drv-loop.sexpr index dac0aa3..8bf6d7a 100644 --- a/tests/xml2sexprdata/xml2sexpr-disk-drv-loop.sexpr +++ b/tests/xml2sexprdata/xml2sexpr-disk-drv-loop.sexpr @@ -4,5 +4,7 @@ (image (linux (kernel '/var/lib/xen/vmlinuz.2Dn2YT')\ (ramdisk '/var/lib/xen/initrd.img.0u-Vhq')\ (args ' method=http://download.fedora.devel.redhat.com/pub/fedora/linux/\ -core/test/5.91/x86_64/os ')))(device (vbd (dev 'xvda')\ +core/test/5.91/x86_64/os ')))\ +(localtime 0)\ +(device (vbd (dev 'xvda')\ (uname 'file:/root/some.img')(mode 'w'))))\ diff --git a/tests/xml2sexprdata/xml2sexpr-disk-file.sexpr b/tests/xml2sexprdata/xml2sexpr-disk-file.sexpr index dac0aa3..8bf6d7a 100644 --- a/tests/xml2sexprdata/xml2sexpr-disk-file.sexpr +++ b/tests/xml2sexprdata/xml2sexpr-disk-file.sexpr @@ -4,5 +4,7 @@ (image (linux (kernel '/var/lib/xen/vmlinuz.2Dn2YT')\ (ramdisk '/var/lib/xen/initrd.img.0u-Vhq')\ (args ' method=http://download.fedora.devel.redhat.com/pub/fedora/linux/\ -core/test/5.91/x86_64/os ')))(device (vbd (dev 'xvda')\ +core/test/5.91/x86_64/os ')))\ +(localtime 0)\ +(device (vbd (dev 'xvda')\ (uname 'file:/root/some.img')(mode 'w'))))\ diff --git a/tests/xml2sexprdata/xml2sexpr-escape.sexpr b/tests/xml2sexprdata/xml2sexpr-escape.sexpr index 7b29131..7f70adb 100644 --- a/tests/xml2sexprdata/xml2sexpr-escape.sexpr +++ b/tests/xml2sexprdata/xml2sexpr-escape.sexpr @@ -7,4 +7,5 @@ core/test/5.91/x86_64/os&version="devel" ')\ (loader '/usr/lib/xen/boot/hvmloader')(vcpus 2)(boot c)(usb 1)(parallel none)\ (serial pty)(device_model '/usr/lib/xen/bin/qemu-dm')))\ +(localtime 0)\ (device (vbd (dev 'ioemu:xvda')(uname 'file:/root/\'\\some.img')(mode 'w'))))\ diff --git a/tests/xml2sexprdata/xml2sexpr-fv-force-hpet.sexpr b/tests/xml2sexprdata/xml2sexpr-fv-force-hpet.sexpr index 400872d..e1486b5 100644 --- a/tests/xml2sexprdata/xml2sexpr-fv-force-hpet.sexpr +++ b/tests/xml2sexprdata/xml2sexpr-fv-force-hpet.sexpr @@ -4,6 +4,7 @@ (image (hvm (kernel '/usr/lib/xen/boot/hvmloader')(vcpus 1)(boot c)\ (cdrom '/root/boot.iso')(acpi 1)(usb 1)(parallel none)(serial none)\ (device_model '/usr/lib64/xen/bin/qemu-dm')(hpet 1)(vnc 1)))\ +(localtime 0)\ (device (vbd (dev 'ioemu:hda')(uname 'file:/root/foo.img')(mode 'w')))\ (device (vif (mac '00:16:3e:1b:b1:47')(bridge 'xenbr0')(script 'vif-bridge')\ (model 'e1000')(type ioemu))))\ diff --git a/tests/xml2sexprdata/xml2sexpr-fv-force-nohpet.sexpr b/tests/xml2sexprdata/xml2sexpr-fv-force-nohpet.sexpr index 9577892..a396cea 100644 --- a/tests/xml2sexprdata/xml2sexpr-fv-force-nohpet.sexpr +++ b/tests/xml2sexprdata/xml2sexpr-fv-force-nohpet.sexpr @@ -4,6 +4,7 @@ (image (hvm (kernel '/usr/lib/xen/boot/hvmloader')(vcpus 1)(boot c)\ (cdrom '/root/boot.iso')(acpi 1)(usb 1)(parallel none)(serial none)\ (device_model '/usr/lib64/xen/bin/qemu-dm')(hpet 0)(vnc 1)))\ +(localtime 0)\ (device (vbd (dev 'ioemu:hda')(uname 'file:/root/foo.img')(mode 'w')))\ (device (vif (mac '00:16:3e:1b:b1:47')(bridge 'xenbr0')(script 'vif-bridge')\ (model 'e1000')(type ioemu))))\ diff --git a/tests/xml2sexprdata/xml2sexpr-fv-kernel.sexpr b/tests/xml2sexprdata/xml2sexpr-fv-kernel.sexpr index 4950832..edaa775 100644 --- a/tests/xml2sexprdata/xml2sexpr-fv-kernel.sexpr +++ b/tests/xml2sexprdata/xml2sexpr-fv-kernel.sexpr @@ -7,4 +7,5 @@ core/test/5.91/x86_64/os ')(loader '/usr/lib/xen/boot/hvmloader')(vcpus 2)\ (boot c)(usb 1)(parallel none)(serial pty)\ (device_model '/usr/lib/xen/bin/qemu-dm')))\ +(localtime 0)\ (device (vbd (dev 'ioemu:xvda')(uname 'file:/root/some.img')(mode 'w'))))\ diff --git a/tests/xml2sexprdata/xml2sexpr-fv-localtime.sexpr b/tests/xml2sexprdata/xml2sexpr-fv-localtime.sexpr index 4f91119..3ba7e96 100644 --- a/tests/xml2sexprdata/xml2sexpr-fv-localtime.sexpr +++ b/tests/xml2sexprdata/xml2sexpr-fv-localtime.sexpr @@ -1,9 +1,10 @@ (vm (name 'fvtest')(memory 400)(maxmem 400)(vcpus 1)\ (uuid 'b5d70dd2-75cd-aca5-1776-9660b059d8bc')(on_poweroff 'destroy')\ -(on_reboot 'restart')(on_crash 'restart')(localtime 1)\ +(on_reboot 'restart')(on_crash 'restart')\ (image (hvm (kernel '/usr/lib/xen/boot/hvmloader')(vcpus 1)(boot c)\ (cdrom '/root/boot.iso')(acpi 1)(usb 1)(parallel none)(serial none)\ -(localtime 1)(device_model '/usr/lib64/xen/bin/qemu-dm')(vnc 1)))\ +(device_model '/usr/lib64/xen/bin/qemu-dm')(vnc 1)))\ +(localtime 1)\ (device (vbd (dev 'ioemu:hda')(uname 'file:/root/foo.img')(mode 'w')))\ (device (vif (mac '00:16:3e:1b:b1:47')(bridge 'xenbr0')(script 'vif-bridge')\ (model 'e1000')(type ioemu))))\ diff --git a/tests/xml2sexprdata/xml2sexpr-fv-net-ioemu.sexpr b/tests/xml2sexprdata/xml2sexpr-fv-net-ioemu.sexpr index 71df15b..20f9228 100644 --- a/tests/xml2sexprdata/xml2sexpr-fv-net-ioemu.sexpr +++ b/tests/xml2sexprdata/xml2sexpr-fv-net-ioemu.sexpr @@ -3,6 +3,7 @@ (on_reboot 'restart')(on_crash 'restart')\ (image (hvm (kernel '/usr/lib/xen/boot/hvmloader')(vcpus 1)(boot c)(acpi 1)\ (usb 1)(parallel none)(serial none)(device_model '/usr/lib64/xen/bin/qemu-dm')\ -(vnc 1)))(device (vbd (dev 'ioemu:hda')(uname 'file:/root/foo.img')\ +(vnc 1)))(localtime 0)\ +(device (vbd (dev 'ioemu:hda')(uname 'file:/root/foo.img')\ (mode 'w')))(device (vif (mac '00:16:3e:1b:b1:47')(bridge 'xenbr0')\ (script 'vif-bridge')(model 'e1000')(type ioemu))))\ diff --git a/tests/xml2sexprdata/xml2sexpr-fv-net-netfront.sexpr b/tests/xml2sexprdata/xml2sexpr-fv-net-netfront.sexpr index 7fe2544..cab2d96 100644 --- a/tests/xml2sexprdata/xml2sexpr-fv-net-netfront.sexpr +++ b/tests/xml2sexprdata/xml2sexpr-fv-net-netfront.sexpr @@ -3,6 +3,7 @@ (on_reboot 'restart')(on_crash 'restart')\ (image (hvm (kernel '/usr/lib/xen/boot/hvmloader')(vcpus 1)(boot c)(acpi 1)\ (usb 1)(parallel none)(serial none)(device_model '/usr/lib64/xen/bin/qemu-dm')\ -(vnc 1)))(device (vbd (dev 'ioemu:hda')(uname 'file:/root/foo.img')\ +(vnc 1)))(localtime 0)\ +(device (vbd (dev 'ioemu:hda')(uname 'file:/root/foo.img')\ (mode 'w')))(device (vif (mac '00:16:3e:1b:b1:47')(bridge 'xenbr0')\ (script 'vif-bridge')(type netfront))))\ diff --git a/tests/xml2sexprdata/xml2sexpr-fv-parallel-tcp.sexpr b/tests/xml2sexprdata/xml2sexpr-fv-parallel-tcp.sexpr index 38504b1..14c5e5e 100644 --- a/tests/xml2sexprdata/xml2sexpr-fv-parallel-tcp.sexpr +++ b/tests/xml2sexprdata/xml2sexpr-fv-parallel-tcp.sexpr @@ -4,6 +4,7 @@ (image (hvm (kernel '/usr/lib/xen/boot/hvmloader')(vcpus 1)(boot c)\ (cdrom '/root/boot.iso')(acpi 1)(usb 1)(parallel tcp:localhost:9999)\ (serial none)(device_model '/usr/lib64/xen/bin/qemu-dm')(vnc 1)))\ +(localtime 0)\ (device (vbd (dev 'ioemu:hda')(uname 'file:/root/foo.img')(mode 'w')))\ (device (vif (mac '00:16:3e:1b:b1:47')(bridge 'xenbr0')(script 'vif-bridge')\ (model 'e1000')(type ioemu))))\ diff --git a/tests/xml2sexprdata/xml2sexpr-fv-serial-dev-2-ports.sexpr b/tests/xml2sexprdata/xml2sexpr-fv-serial-dev-2-ports.sexpr index f3bfbd7..16dcbf2 100644 --- a/tests/xml2sexprdata/xml2sexpr-fv-serial-dev-2-ports.sexpr +++ b/tests/xml2sexprdata/xml2sexpr-fv-serial-dev-2-ports.sexpr @@ -4,6 +4,7 @@ (image (hvm (kernel '/usr/lib/xen/boot/hvmloader')(vcpus 1)(boot c)\ (cdrom '/root/boot.iso')(acpi 1)(usb 1)(parallel none)\ (serial (/dev/ttyS0 /dev/ttyS1))(device_model '/usr/lib64/xen/bin/qemu-dm')\ -(vnc 1)))(device (vbd (dev 'ioemu:hda')(uname 'file:/root/foo.img')\ +(vnc 1)))(localtime 0)\ +(device (vbd (dev 'ioemu:hda')(uname 'file:/root/foo.img')\ (mode 'w')))(device (vif (mac '00:16:3e:1b:b1:47')(bridge 'xenbr0')\ (script 'vif-bridge')(model 'e1000')(type ioemu))))\ diff --git a/tests/xml2sexprdata/xml2sexpr-fv-serial-dev-2nd-port.sexpr b/tests/xml2sexprdata/xml2sexpr-fv-serial-dev-2nd-port.sexpr index 9ecbbe0..45a7585 100644 --- a/tests/xml2sexprdata/xml2sexpr-fv-serial-dev-2nd-port.sexpr +++ b/tests/xml2sexprdata/xml2sexpr-fv-serial-dev-2nd-port.sexpr @@ -4,6 +4,7 @@ (image (hvm (kernel '/usr/lib/xen/boot/hvmloader')(vcpus 1)(boot c)\ (cdrom '/root/boot.iso')(acpi 1)(usb 1)(parallel none)\ (serial (none /dev/ttyS1))(device_model '/usr/lib64/xen/bin/qemu-dm')(vnc 1)))\ +(localtime 0)\ (device (vbd (dev 'ioemu:hda')(uname 'file:/root/foo.img')(mode 'w')))\ (device (vif (mac '00:16:3e:1b:b1:47')(bridge 'xenbr0')(script 'vif-bridge')\ (model 'e1000')(type ioemu))))\ diff --git a/tests/xml2sexprdata/xml2sexpr-fv-serial-file.sexpr b/tests/xml2sexprdata/xml2sexpr-fv-serial-file.sexpr index be40218..90bd2b5 100644 --- a/tests/xml2sexprdata/xml2sexpr-fv-serial-file.sexpr +++ b/tests/xml2sexprdata/xml2sexpr-fv-serial-file.sexpr @@ -4,6 +4,7 @@ (image (hvm (kernel '/usr/lib/xen/boot/hvmloader')(vcpus 1)(boot c)\ (cdrom '/root/boot.iso')(acpi 1)(usb 1)(parallel none)\ (serial file:/tmp/serial.log)(device_model '/usr/lib64/xen/bin/qemu-dm')\ -(vnc 1)))(device (vbd (dev 'ioemu:hda')(uname 'file:/root/foo.img')\ +(vnc 1)))(localtime 0)\ +(device (vbd (dev 'ioemu:hda')(uname 'file:/root/foo.img')\ (mode 'w')))(device (vif (mac '00:16:3e:1b:b1:47')(bridge 'xenbr0')\ (script 'vif-bridge')(model 'e1000')(type ioemu))))\ diff --git a/tests/xml2sexprdata/xml2sexpr-fv-serial-null.sexpr b/tests/xml2sexprdata/xml2sexpr-fv-serial-null.sexpr index 40243a7..09f4a33 100644 --- a/tests/xml2sexprdata/xml2sexpr-fv-serial-null.sexpr +++ b/tests/xml2sexprdata/xml2sexpr-fv-serial-null.sexpr @@ -4,6 +4,7 @@ (image (hvm (kernel '/usr/lib/xen/boot/hvmloader')(vcpus 1)(boot c)\ (cdrom '/root/boot.iso')(acpi 1)(usb 1)(parallel none)(serial null)\ (device_model '/usr/lib64/xen/bin/qemu-dm')(vnc 1)))\ +(localtime 0)\ (device (vbd (dev 'ioemu:hda')(uname 'file:/root/foo.img')(mode 'w')))\ (device (vif (mac '00:16:3e:1b:b1:47')(bridge 'xenbr0')(script 'vif-bridge')\ (model 'e1000')(type ioemu))))\ diff --git a/tests/xml2sexprdata/xml2sexpr-fv-serial-pipe.sexpr b/tests/xml2sexprdata/xml2sexpr-fv-serial-pipe.sexpr index 4e2dc78..a620016 100644 --- a/tests/xml2sexprdata/xml2sexpr-fv-serial-pipe.sexpr +++ b/tests/xml2sexprdata/xml2sexpr-fv-serial-pipe.sexpr @@ -4,6 +4,7 @@ (image (hvm (kernel '/usr/lib/xen/boot/hvmloader')(vcpus 1)(boot c)\ (cdrom '/root/boot.iso')(acpi 1)(usb 1)(parallel none)\ (serial pipe:/tmp/serial.pipe)(device_model '/usr/lib64/xen/bin/qemu-dm')\ -(vnc 1)))(device (vbd (dev 'ioemu:hda')(uname 'file:/root/foo.img')\ +(vnc 1)))(localtime 0)\ +(device (vbd (dev 'ioemu:hda')(uname 'file:/root/foo.img')\ (mode 'w')))(device (vif (mac '00:16:3e:1b:b1:47')(bridge 'xenbr0')\ (script 'vif-bridge')(model 'e1000')(type ioemu))))\ diff --git a/tests/xml2sexprdata/xml2sexpr-fv-serial-pty.sexpr b/tests/xml2sexprdata/xml2sexpr-fv-serial-pty.sexpr index 7ae9315..9ad9d42 100644 --- a/tests/xml2sexprdata/xml2sexpr-fv-serial-pty.sexpr +++ b/tests/xml2sexprdata/xml2sexpr-fv-serial-pty.sexpr @@ -4,6 +4,7 @@ (image (hvm (kernel '/usr/lib/xen/boot/hvmloader')(vcpus 1)(boot c)\ (cdrom '/root/boot.iso')(acpi 1)(usb 1)(parallel none)(serial pty)\ (device_model '/usr/lib64/xen/bin/qemu-dm')(vnc 1)))\ +(localtime 0)\ (device (vbd (dev 'ioemu:hda')(uname 'file:/root/foo.img')(mode 'w')))\ (device (vif (mac '00:16:3e:1b:b1:47')(bridge 'xenbr0')(script 'vif-bridge')\ (model 'e1000')(type ioemu))))\ diff --git a/tests/xml2sexprdata/xml2sexpr-fv-serial-stdio.sexpr b/tests/xml2sexprdata/xml2sexpr-fv-serial-stdio.sexpr index 8369bb4..9fc7837 100644 --- a/tests/xml2sexprdata/xml2sexpr-fv-serial-stdio.sexpr +++ b/tests/xml2sexprdata/xml2sexpr-fv-serial-stdio.sexpr @@ -4,6 +4,7 @@ (image (hvm (kernel '/usr/lib/xen/boot/hvmloader')(vcpus 1)(boot c)\ (cdrom '/root/boot.iso')(acpi 1)(usb 1)(parallel none)(serial stdio)\ (device_model '/usr/lib64/xen/bin/qemu-dm')(vnc 1)))\ +(localtime 0)\ (device (vbd (dev 'ioemu:hda')(uname 'file:/root/foo.img')(mode 'w')))\ (device (vif (mac '00:16:3e:1b:b1:47')(bridge 'xenbr0')(script 'vif-bridge')\ (model 'e1000')(type ioemu))))\ diff --git a/tests/xml2sexprdata/xml2sexpr-fv-serial-tcp-telnet.sexpr b/tests/xml2sexprdata/xml2sexpr-fv-serial-tcp-telnet.sexpr index 40120cf..337ad51 100644 --- a/tests/xml2sexprdata/xml2sexpr-fv-serial-tcp-telnet.sexpr +++ b/tests/xml2sexprdata/xml2sexpr-fv-serial-tcp-telnet.sexpr @@ -5,6 +5,7 @@ (cdrom '/root/boot.iso')(acpi 1)(usb 1)(parallel none)\ (serial telnet:localhost:9999,server,nowait)\ (device_model '/usr/lib64/xen/bin/qemu-dm')(vnc 1)))\ +(localtime 0)\ (device (vbd (dev 'ioemu:hda')(uname 'file:/root/foo.img')(mode 'w')))\ (device (vif (mac '00:16:3e:1b:b1:47')(bridge 'xenbr0')(script 'vif-bridge')\ (model 'e1000')(type ioemu))))\ diff --git a/tests/xml2sexprdata/xml2sexpr-fv-serial-tcp.sexpr b/tests/xml2sexprdata/xml2sexpr-fv-serial-tcp.sexpr index 7938a7b..e77ed9f 100644 --- a/tests/xml2sexprdata/xml2sexpr-fv-serial-tcp.sexpr +++ b/tests/xml2sexprdata/xml2sexpr-fv-serial-tcp.sexpr @@ -5,6 +5,7 @@ (cdrom '/root/boot.iso')(acpi 1)(usb 1)(parallel none)\ (serial tcp:localhost:9999,server,nowait)\ (device_model '/usr/lib64/xen/bin/qemu-dm')(vnc 1)))\ +(localtime 0)\ (device (vbd (dev 'ioemu:hda')(uname 'file:/root/foo.img')(mode 'w')))\ (device (vif (mac '00:16:3e:1b:b1:47')(bridge 'xenbr0')(script 'vif-bridge')\ (model 'e1000')(type ioemu))))\ diff --git a/tests/xml2sexprdata/xml2sexpr-fv-serial-udp.sexpr b/tests/xml2sexprdata/xml2sexpr-fv-serial-udp.sexpr index 3c19f25..bb7487e 100644 --- a/tests/xml2sexprdata/xml2sexpr-fv-serial-udp.sexpr +++ b/tests/xml2sexprdata/xml2sexpr-fv-serial-udp.sexpr @@ -5,6 +5,7 @@ (cdrom '/root/boot.iso')(acpi 1)(usb 1)(parallel none)\ (serial udp:localhost:9998@localhost:9999)\ (device_model '/usr/lib64/xen/bin/qemu-dm')(vnc 1)))\ +(localtime 0)\ (device (vbd (dev 'ioemu:hda')(uname 'file:/root/foo.img')(mode 'w')))\ (device (vif (mac '00:16:3e:1b:b1:47')(bridge 'xenbr0')(script 'vif-bridge')\ (model 'e1000')(type ioemu))))\ diff --git a/tests/xml2sexprdata/xml2sexpr-fv-serial-unix.sexpr b/tests/xml2sexprdata/xml2sexpr-fv-serial-unix.sexpr index 67ceeaa..3686f42 100644 --- a/tests/xml2sexprdata/xml2sexpr-fv-serial-unix.sexpr +++ b/tests/xml2sexprdata/xml2sexpr-fv-serial-unix.sexpr @@ -5,6 +5,7 @@ (cdrom '/root/boot.iso')(acpi 1)(usb 1)(parallel none)\ (serial unix:/tmp/serial.sock,server,nowait)\ (device_model '/usr/lib64/xen/bin/qemu-dm')(vnc 1)))\ +(localtime 0)\ (device (vbd (dev 'ioemu:hda')(uname 'file:/root/foo.img')(mode 'w')))\ (device (vif (mac '00:16:3e:1b:b1:47')(bridge 'xenbr0')(script 'vif-bridge')\ (model 'e1000')(type ioemu))))\ diff --git a/tests/xml2sexprdata/xml2sexpr-fv-sound.sexpr b/tests/xml2sexprdata/xml2sexpr-fv-sound.sexpr index 4c37c35..c00f833 100644 --- a/tests/xml2sexprdata/xml2sexpr-fv-sound.sexpr +++ b/tests/xml2sexprdata/xml2sexpr-fv-sound.sexpr @@ -4,6 +4,7 @@ (image (hvm (kernel '/usr/lib/xen/boot/hvmloader')(vcpus 1)(boot c)\ (cdrom '/root/boot.iso')(acpi 1)(usb 1)(parallel none)(serial none)\ (soundhw 'sb16,es1370')(device_model '/usr/lib64/xen/bin/qemu-dm')(vnc 1)))\ +(localtime 0)\ (device (vbd (dev 'ioemu:hda')(uname 'file:/root/foo.img')(mode 'w')))\ (device (vif (mac '00:16:3e:1b:b1:47')(bridge 'xenbr0')(script 'vif-bridge')\ (model 'e1000')(type ioemu))))\ diff --git a/tests/xml2sexprdata/xml2sexpr-fv-usbmouse.sexpr b/tests/xml2sexprdata/xml2sexpr-fv-usbmouse.sexpr index c0ad2bc..e8733dc 100644 --- a/tests/xml2sexprdata/xml2sexpr-fv-usbmouse.sexpr +++ b/tests/xml2sexprdata/xml2sexpr-fv-usbmouse.sexpr @@ -4,6 +4,7 @@ (image (hvm (kernel '/usr/lib/xen/boot/hvmloader')(vcpus 1)(boot c)\ (cdrom '/root/boot.iso')(acpi 1)(usb 1)(usbdevice mouse)(parallel none)\ (serial none)(device_model '/usr/lib64/xen/bin/qemu-dm')(vnc 1)))\ +(localtime 0)\ (device (vbd (dev 'ioemu:hda')(uname 'file:/root/foo.img')(mode 'w')))\ (device (vif (mac '00:16:3e:1b:b1:47')(bridge 'xenbr0')(script 'vif-bridge')\ (model 'e1000')(type ioemu))))\ diff --git a/tests/xml2sexprdata/xml2sexpr-fv-usbtablet.sexpr b/tests/xml2sexprdata/xml2sexpr-fv-usbtablet.sexpr index ff1c695..6a192bb 100644 --- a/tests/xml2sexprdata/xml2sexpr-fv-usbtablet.sexpr +++ b/tests/xml2sexprdata/xml2sexpr-fv-usbtablet.sexpr @@ -3,7 +3,8 @@ (on_reboot 'restart')(on_crash 'restart')\ (image (hvm (kernel '/usr/lib/xen/boot/hvmloader')(vcpus 1)(boot c)\ (cdrom '/root/boot.iso')(acpi 1)(usb 1)(usbdevice tablet)(parallel none)\ -(serial none)(device_model '/usr/lib64/xen/bin/qemu-dm')(vnc 1)))\ +(serial none)(device_model '/usr/lib64/xen/bin/qemu-dm')(vnc 1)\ +(rtc_timeoffset 0)(localtime 0)))\ (device (vbd (dev 'ioemu:hda')(uname 'file:/root/foo.img')(mode 'w')))\ (device (vif (mac '00:16:3e:1b:b1:47')(bridge 'xenbr0')(script 'vif-bridge')\ (type ioemu))))\ diff --git a/tests/xml2sexprdata/xml2sexpr-fv-utc.sexpr b/tests/xml2sexprdata/xml2sexpr-fv-utc.sexpr index 81fb92d..b39c832 100644 --- a/tests/xml2sexprdata/xml2sexpr-fv-utc.sexpr +++ b/tests/xml2sexprdata/xml2sexpr-fv-utc.sexpr @@ -4,6 +4,7 @@ (image (hvm (kernel '/usr/lib/xen/boot/hvmloader')(vcpus 1)(boot c)\ (cdrom '/root/boot.iso')(acpi 1)(usb 1)(parallel none)(serial none)\ (device_model '/usr/lib64/xen/bin/qemu-dm')(vnc 1)))\ +(localtime 0)\ (device (vbd (dev 'ioemu:hda')(uname 'file:/root/foo.img')(mode 'w')))\ (device (vif (mac '00:16:3e:1b:b1:47')(bridge 'xenbr0')(script 'vif-bridge')\ (model 'e1000')(type ioemu))))\ diff --git a/tests/xml2sexprdata/xml2sexpr-fv-v2.sexpr b/tests/xml2sexprdata/xml2sexpr-fv-v2.sexpr index b27e990..78ecfb5 100644 --- a/tests/xml2sexprdata/xml2sexpr-fv-v2.sexpr +++ b/tests/xml2sexprdata/xml2sexpr-fv-v2.sexpr @@ -4,6 +4,7 @@ (image (hvm (kernel '/usr/lib/xen/boot/hvmloader')(vcpus 1)(boot c)(acpi 1)\ (usb 1)(parallel none)(serial none)(device_model '/usr/lib64/xen/bin/qemu-dm')\ (vnc 1)(vncunused 0)(vncdisplay 17)(keymap 'ja')))\ +(localtime 0)\ (device (vbd (dev 'hda:disk')(uname 'file:/root/foo.img')(mode 'w')))\ (device (vbd (dev 'hdc:cdrom')(uname 'file:/root/boot.iso')(mode 'r')))\ (device (vif (mac '00:16:3e:1b:b1:47')(bridge 'xenbr0')(script 'vif-bridge')\ diff --git a/tests/xml2sexprdata/xml2sexpr-fv-vncunused.sexpr b/tests/xml2sexprdata/xml2sexpr-fv-vncunused.sexpr index 908ae94..74c4174 100644 --- a/tests/xml2sexprdata/xml2sexpr-fv-vncunused.sexpr +++ b/tests/xml2sexprdata/xml2sexpr-fv-vncunused.sexpr @@ -3,7 +3,8 @@ (on_reboot 'restart')(on_crash 'restart')\ (image (hvm (kernel '/usr/lib/xen/boot/hvmloader')(vcpus 1)(boot c)(acpi 1)\ (usb 1)(parallel none)(serial none)(device_model '/usr/lib64/xen/bin/qemu-dm')\ -(vnc 1)(vncunused 1)(keymap 'ja')))(device (vbd (dev 'hda:disk')\ +(vnc 1)(vncunused 1)(keymap 'ja')))\ +(localtime 0)(device (vbd (dev 'hda:disk')\ (uname 'file:/root/foo.img')(mode 'w')))(device (vbd (dev 'hdc:cdrom')\ (uname 'file:/root/boot.iso')(mode 'r')))\ (device (vif (mac '00:16:3e:1b:b1:47')(bridge 'xenbr0')(script 'vif-bridge')\ diff --git a/tests/xml2sexprdata/xml2sexpr-fv.sexpr b/tests/xml2sexprdata/xml2sexpr-fv.sexpr index 81fb92d..b39c832 100644 --- a/tests/xml2sexprdata/xml2sexpr-fv.sexpr +++ b/tests/xml2sexprdata/xml2sexpr-fv.sexpr @@ -4,6 +4,7 @@ (image (hvm (kernel '/usr/lib/xen/boot/hvmloader')(vcpus 1)(boot c)\ (cdrom '/root/boot.iso')(acpi 1)(usb 1)(parallel none)(serial none)\ (device_model '/usr/lib64/xen/bin/qemu-dm')(vnc 1)))\ +(localtime 0)\ (device (vbd (dev 'ioemu:hda')(uname 'file:/root/foo.img')(mode 'w')))\ (device (vif (mac '00:16:3e:1b:b1:47')(bridge 'xenbr0')(script 'vif-bridge')\ (model 'e1000')(type ioemu))))\ diff --git a/tests/xml2sexprdata/xml2sexpr-net-bridged.sexpr b/tests/xml2sexprdata/xml2sexpr-net-bridged.sexpr index 0c0c62e..f595f80 100644 --- a/tests/xml2sexprdata/xml2sexpr-net-bridged.sexpr +++ b/tests/xml2sexprdata/xml2sexpr-net-bridged.sexpr @@ -4,7 +4,7 @@ (image (linux (kernel '/var/lib/xen/vmlinuz.2Dn2YT')\ (ramdisk '/var/lib/xen/initrd.img.0u-Vhq')\ (args ' method=http://download.fedora.devel.redhat.com/pub/fedora/linux/\ -core/test/5.91/x86_64/os ')))(device (vbd (dev 'xvda')\ +core/test/5.91/x86_64/os ')))(localtime 0)(device (vbd (dev 'xvda')\ (uname 'file:/root/some.img')(mode 'w')))\ (device (vif (mac '00:11:22:33:44:55')(bridge 'xenbr2')\ (script 'vif-bridge'))))\ diff --git a/tests/xml2sexprdata/xml2sexpr-net-e1000.sexpr b/tests/xml2sexprdata/xml2sexpr-net-e1000.sexpr index d95ed82..d7367e6 100644 --- a/tests/xml2sexprdata/xml2sexpr-net-e1000.sexpr +++ b/tests/xml2sexprdata/xml2sexpr-net-e1000.sexpr @@ -4,7 +4,7 @@ (image (linux (kernel '/var/lib/xen/vmlinuz.2Dn2YT')\ (ramdisk '/var/lib/xen/initrd.img.0u-Vhq')\ (args ' method=http://download.fedora.devel.redhat.com/pub/fedora/linux/\ -core/test/5.91/x86_64/os ')))(device (vbd (dev 'xvda')\ +core/test/5.91/x86_64/os ')))(localtime 0)(device (vbd (dev 'xvda')\ (uname 'file:/root/some.img')(mode 'w')))\ (device (vif (mac '00:11:22:33:44:55')(bridge 'xenbr2')\ (script 'vif-bridge')(model 'e1000'))))\ diff --git a/tests/xml2sexprdata/xml2sexpr-net-routed.sexpr b/tests/xml2sexprdata/xml2sexpr-net-routed.sexpr index 3430e31..d502d4b 100644 --- a/tests/xml2sexprdata/xml2sexpr-net-routed.sexpr +++ b/tests/xml2sexprdata/xml2sexpr-net-routed.sexpr @@ -4,7 +4,7 @@ (image (linux (kernel '/var/lib/xen/vmlinuz.2Dn2YT')\ (ramdisk '/var/lib/xen/initrd.img.0u-Vhq')\ (args ' method=http://download.fedora.devel.redhat.com/pub/fedora/linux/\ -core/test/5.91/x86_64/os ')))(device (vbd (dev 'xvda')\ +core/test/5.91/x86_64/os ')))(localtime 0)(device (vbd (dev 'xvda')\ (uname 'file:/root/some.img')(mode 'w')))\ (device (vif (mac '00:11:22:33:44:55')(script 'vif-routed')\ (ip '172.14.5.6'))))\ diff --git a/tests/xml2sexprdata/xml2sexpr-no-source-cdrom.sexpr b/tests/xml2sexprdata/xml2sexpr-no-source-cdrom.sexpr index eeebee3..d5c05e9 100644 --- a/tests/xml2sexprdata/xml2sexpr-no-source-cdrom.sexpr +++ b/tests/xml2sexprdata/xml2sexpr-no-source-cdrom.sexpr @@ -4,6 +4,7 @@ (image (hvm (kernel '/usr/lib/xen/boot/hvmloader')(vcpus 1)(boot c)(acpi 1)\ (apic 1)(pae 1)(usb 1)(parallel none)(serial none)\ (device_model '/usr/lib/xen/bin/qemu-dm')(vnc 1)(vncunused 0)(vncdisplay 6)))\ +(localtime 0)\ (device (vbd (dev 'hda:disk')(uname 'phy:/dev/sda8')(mode 'w')))\ (device (vbd (dev 'hdc:cdrom')(mode 'r')))\ (device (vif (mac '00:16:3e:0a:7b:39')(model 'e1000')(type ioemu))))\ diff --git a/tests/xml2sexprdata/xml2sexpr-pci-devs.sexpr b/tests/xml2sexprdata/xml2sexpr-pci-devs.sexpr index fdc48cf..5ab5d31 100644 --- a/tests/xml2sexprdata/xml2sexpr-pci-devs.sexpr +++ b/tests/xml2sexprdata/xml2sexpr-pci-devs.sexpr @@ -4,7 +4,7 @@ (image (linux (kernel '/var/lib/xen/vmlinuz.2Dn2YT')\ (ramdisk '/var/lib/xen/initrd.img.0u-Vhq')\ (args ' method=http://download.fedora.devel.redhat.com/pub/fedora/linux/\ -core/test/5.91/x86_64/os ')))(device (vbd (dev 'xvda')\ +core/test/5.91/x86_64/os ')))(localtime 0)(device (vbd (dev 'xvda')\ (uname 'phy:/dev/MainVG/GuestLV')(mode 'w')))\ (device (pci (dev (domain 0x0001)(bus 0x0c)(slot 0x1b)(func 0x2))\ (dev (domain 0x0000)(bus 0x01)(slot 0x13)(func 0x0)))))\ diff --git a/tests/xml2sexprdata/xml2sexpr-pv-bootloader-cmdline.sexpr b/tests/xml2sexprdata/xml2sexpr-pv-bootloader-cmdline.sexpr index 236017e..7a3811e 100644 --- a/tests/xml2sexprdata/xml2sexpr-pv-bootloader-cmdline.sexpr +++ b/tests/xml2sexprdata/xml2sexpr-pv-bootloader-cmdline.sexpr @@ -2,4 +2,5 @@ (uuid '596a5d21-71f4-8fb2-e068-e2386a5c413e')(bootloader '/usr/bin/pygrub')\ (bootloader_args '-q')(on_poweroff 'destroy')(on_reboot 'destroy')\ (on_crash 'destroy')(image (linux (args 'xenfb.video=8,1280,1024')))\ +(localtime 0)\ (device (vbd (dev 'xvda')(uname 'file:/root/some.img')(mode 'w'))))\ diff --git a/tests/xml2sexprdata/xml2sexpr-pv-bootloader.sexpr b/tests/xml2sexprdata/xml2sexpr-pv-bootloader.sexpr index c11938e..981f105 100644 --- a/tests/xml2sexprdata/xml2sexpr-pv-bootloader.sexpr +++ b/tests/xml2sexprdata/xml2sexpr-pv-bootloader.sexpr @@ -1,5 +1,7 @@ (vm (name 'pvtest')(memory 420)(maxmem 420)(vcpus 2)\ (uuid '596a5d21-71f4-8fb2-e068-e2386a5c413e')(bootloader '/usr/bin/pypxeboot')\ (bootloader_args 'mac=AA:00:86:e2:35:72')(on_poweroff 'destroy')\ -(on_reboot 'destroy')(on_crash 'destroy')(device (vbd (dev 'xvda')\ +(on_reboot 'destroy')(on_crash 'destroy')\ +(localtime 0)\ +(device (vbd (dev 'xvda')\ (uname 'file:/root/some.img')(mode 'w'))))\ diff --git a/tests/xml2sexprdata/xml2sexpr-pv-vcpus.sexpr b/tests/xml2sexprdata/xml2sexpr-pv-vcpus.sexpr index df854ca..809a7e5 100644 --- a/tests/xml2sexprdata/xml2sexpr-pv-vcpus.sexpr +++ b/tests/xml2sexprdata/xml2sexpr-pv-vcpus.sexpr @@ -4,5 +4,5 @@ (image (linux (kernel '/var/lib/xen/vmlinuz.2Dn2YT')\ (ramdisk '/var/lib/xen/initrd.img.0u-Vhq')\ (args ' method=http://download.fedora.devel.redhat.com/pub/fedora/linux/\ -core/test/5.91/x86_64/os ')))(device (vbd (dev 'xvda')\ +core/test/5.91/x86_64/os ')))(localtime 0)(device (vbd (dev 'xvda')\ (uname 'file:/root/some.img')(mode 'w'))))\ diff --git a/tests/xml2sexprdata/xml2sexpr-pv-vfb-new-auto.sexpr b/tests/xml2sexprdata/xml2sexpr-pv-vfb-new-auto.sexpr index 5eb0133..70d2edf 100644 --- a/tests/xml2sexprdata/xml2sexpr-pv-vfb-new-auto.sexpr +++ b/tests/xml2sexprdata/xml2sexpr-pv-vfb-new-auto.sexpr @@ -4,7 +4,7 @@ (image (linux (kernel '/var/lib/xen/vmlinuz.2Dn2YT')\ (ramdisk '/var/lib/xen/initrd.img.0u-Vhq')\ (args ' method=http://download.fedora.devel.redhat.com/pub/fedora/linux/\ -core/test/5.91/x86_64/os ')))(device (vbd (dev 'xvda')\ +core/test/5.91/x86_64/os ')))(localtime 0)(device (vbd (dev 'xvda')\ (uname 'file:/root/some.img')(mode 'w')))(device (vkbd))\ (device (vfb (type vnc)(vncunused 1)(vnclisten '127.0.0.1')\ (vncpasswd '123456')(keymap 'ja'))))\ diff --git a/tests/xml2sexprdata/xml2sexpr-pv-vfb-new.sexpr b/tests/xml2sexprdata/xml2sexpr-pv-vfb-new.sexpr index c74098f..9bace13 100644 --- a/tests/xml2sexprdata/xml2sexpr-pv-vfb-new.sexpr +++ b/tests/xml2sexprdata/xml2sexpr-pv-vfb-new.sexpr @@ -4,7 +4,7 @@ (image (linux (kernel '/var/lib/xen/vmlinuz.2Dn2YT')\ (ramdisk '/var/lib/xen/initrd.img.0u-Vhq')\ (args ' method=http://download.fedora.devel.redhat.com/pub/fedora/linux/\ -core/test/5.91/x86_64/os ')))(device (vbd (dev 'xvda')\ +core/test/5.91/x86_64/os ')))(localtime 0)(device (vbd (dev 'xvda')\ (uname 'file:/root/some.img')(mode 'w')))(device (vkbd))\ (device (vfb (type vnc)(vncunused 0)(vncdisplay 6)(vnclisten '127.0.0.1')\ (vncpasswd '123456')(keymap 'ja'))))\ diff --git a/tests/xml2sexprdata/xml2sexpr-pv-vfb-orig.sexpr b/tests/xml2sexprdata/xml2sexpr-pv-vfb-orig.sexpr index 1e22b83..c2c1290 100644 --- a/tests/xml2sexprdata/xml2sexpr-pv-vfb-orig.sexpr +++ b/tests/xml2sexprdata/xml2sexpr-pv-vfb-orig.sexpr @@ -6,4 +6,5 @@ (args ' method=http://download.fedora.devel.redhat.com/pub/fedora/linux/\ core/test/5.91/x86_64/os ')(vnc 1)(vncunused 0)(vncdisplay 6)\ (vnclisten '127.0.0.1')(vncpasswd '123456')(keymap 'ja')))\ +(localtime 0)\ (device (vbd (dev 'xvda')(uname 'file:/root/some.img')(mode 'w'))))\ diff --git a/tests/xml2sexprdata/xml2sexpr-pv.sexpr b/tests/xml2sexprdata/xml2sexpr-pv.sexpr index dac0aa3..90efcd7 100644 --- a/tests/xml2sexprdata/xml2sexpr-pv.sexpr +++ b/tests/xml2sexprdata/xml2sexpr-pv.sexpr @@ -4,5 +4,5 @@ (image (linux (kernel '/var/lib/xen/vmlinuz.2Dn2YT')\ (ramdisk '/var/lib/xen/initrd.img.0u-Vhq')\ (args ' method=http://download.fedora.devel.redhat.com/pub/fedora/linux/\ -core/test/5.91/x86_64/os ')))(device (vbd (dev 'xvda')\ +core/test/5.91/x86_64/os ')))(localtime 0)(device (vbd (dev 'xvda')\ (uname 'file:/root/some.img')(mode 'w'))))\ -- 1.7.1

On 02/09/2012 04:36 AM, Philipp Hahn wrote:
Before version 3.1 xen only implemented clock/@offset='utc' and 'localtime'. With the introduction of managed domains in 3.1 xend keeps track of the rtc_timeoffset, even over reboots. This translates to libvirts clock/@offset='variable' variant. Be advised that only HV domains have a RTC.
In addition xen also supports a variant where the offset is tracked to 'localtime', which is currently not supported by libvirt. To make matters worse, this was somehow broken in some versions of xen and was finally fixed with version xen-3.4.
The following patch set ... * adds support for handling variable offsets relative to localtime, * fixes libvirt to use clock/@offset='variable' for newer xen versions, * adapts the test suit accordingly
I've tested this on CenOS5 (xend-3.0.3 + 3.1.2 hypervisor?), UCS-2.3 (xen-3.2.1), UCS-2.4 (xen-3.4.3) and UCS-3.0 (xen-4.1.2).
Since v1: + fix handling of direct-PV-domains + added handling of localtime=1 + rtc_timeoffset + fixed test suite
Questions: 1. Handling of legacy XML domain configurations I'm reluctant to define LIBVIRT_XEND_CLOCK_STRICT, since this would probably break many existing XML configuration files, since they would be rejected libvirt now for still using clock/@offset='utc'/'localtime'. Luckily for us libvirt doesn't support snapshots with xen, because then this XML configuration would be stored in the snapshot meta data, rendering them all invalid.
We absolutely cannot reject existing older xml files; but must load them with the semantics that make sense. If I understand correctly, the situation is that old clients had: <clock offset='localtime'/> whereas the semantics are more correctly listed as your proposed: <clock offset='variable' adjustment='nnn' basis='localtime'/> and you are worried that if you rewrite the former into the latter, you are preserving the semantics that make the most sense as a default, but you are making it impossible to implement alternate semantics that are also possible with xen and which are documented as the current behavior. Your idea was to compile two versions of libvirt, either with or without -DLIBVIRT_XEND_CLOCK_STRICT. But a better idea is to represent the XML in a way where the default conversion makes sense, but where a user can explicitly change the XML to get what they want. I'm thinking: If offset is 'utc' or 'localtime', we add a new attribute 'adjustment', whose value can be either 'reset' to signify that the offset is reset on each boot, or a timeDelta, as shorthand for specifying offset='variable' adjustment='nnn' basis='utc|localtime'. If the attribute is missing, the hypervisor determines whether the default is 'reset' or '0'. Qemu would pick 'reset', xend would pick '0'. That way, we would convert domains by default, but a user that _wants_ the documented reset abilities can add adjustment='reset' to their XML and force us to leave things alone, without having a compilation switch. When writing XML back out via dumpxml, libvirt would generate either the offset='utc' adjustment='reset', or the offset='variable' adjustment='nnn' basis='utc'; and would not generate offset='utc' adjustment='nnn', even though that is a valid input form. That will touch a bit more in the testsuite (all qemu tests would also end up being converted by the new output), but would make things more specific, and still give the user runtime control over XML behavior without having to resort to recompilation of libvirt with a new compiler macro. RNG-wise, this would be: <element name='clock'> <choice> <group> <attribute name='offset'> <choice> <value>localtime</value> <value>utc</value> </choice> </attribute> <optional> <attribute name='adjustment'> <choice> <ref name='timeDelta'/> <value>reset</value> </choice> </attribute> </optional> </group> <group> <attribute name='offset'> <value>timezone</value> </attribute> <optional> <attribute name='timezone'> <ref name='timeZone'/> </attribute> </optional> </group> <group> <attribute name='offset'> <value>variable</value> </attribute> <optional> <attribute name='adjustment'> <ref name='timeDelta'/> </attribute> </optional> </group> </choice> <zeroOrMore> <ref name='timer'/> </zeroOrMore> </element>
2. Error path handling There are now a lot of different cases (PV, HV<3.1, HV>3.1), which all have the same error path. This is somehow ugly to code in C, I hope it's okay to use vmlocaltime=-1 to indicate an error instead of using "goto". But if you have a better idea, please feel free to comments.
I didn't look closely at that part; I'd rather get consensus on the XML first.
3. libvirt-0.9.10 or .11 This patch-series should probably receive some more testing, so for 0.9.10 it's too late. If it's not included, I'd need to update the reference to the version when this patch will get in.
Agreed on this point - we are now at post-0.9.10 material. -- Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On 02/09/2012 03:01 PM, Eric Blake wrote:
We absolutely cannot reject existing older xml files; but must load them with the semantics that make sense.
But a better idea is to represent the XML in a way where the default conversion makes sense, but where a user can explicitly change the XML to get what they want. I'm thinking:
If offset is 'utc' or 'localtime', we add a new attribute 'adjustment', whose value can be either 'reset' to signify that the offset is reset on each boot, or a timeDelta, as shorthand for specifying offset='variable' adjustment='nnn' basis='utc|localtime'. If the attribute is missing, the hypervisor determines whether the default is 'reset' or '0'. Qemu would pick 'reset', xend would pick '0'.
RNG-wise, this would be:
I missed basis:
<element name='clock'> <choice> <group> <attribute name='offset'> <choice> <value>localtime</value> <value>utc</value> </choice> </attribute> <optional> <attribute name='adjustment'> <choice> <ref name='timeDelta'/> <value>reset</value> </choice> </attribute> </optional> </group> <group> <attribute name='offset'> <value>timezone</value> </attribute> <optional> <attribute name='timezone'> <ref name='timeZone'/> </attribute> </optional> </group> <group> <attribute name='offset'> <value>variable</value> </attribute> <optional> <attribute name='adjustment'> <ref name='timeDelta'/> </attribute> </optional>
<optional> <attribute name='basis'> <choice> <value>utc</value> <value>localtime</value> </choice> </attribute> </optional>
</group> </choice> <zeroOrMore> <ref name='timer'/> </zeroOrMore> </element>
-- Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

Hello Eric, On Thursday 09 February 2012 23:01:38 Eric Blake wrote:
Questions: 1. Handling of legacy XML domain configurations I'm reluctant to define LIBVIRT_XEND_CLOCK_STRICT, since this would probably break many existing XML configuration files, since they would be rejected libvirt now for still using clock/@offset='utc'/'localtime'. Luckily for us libvirt doesn't support snapshots with xen, because then this XML configuration would be stored in the snapshot meta data, rendering them all invalid.
We absolutely cannot reject existing older xml files; but must load them with the semantics that make sense.
If I understand correctly, the situation is that old clients had:
<clock offset='localtime'/>
whereas the semantics are more correctly listed as your proposed:
<clock offset='variable' adjustment='nnn' basis='localtime'/>
and you are worried that if you rewrite the former into the latter, you are preserving the semantics that make the most sense as a default, but you are making it impossible to implement alternate semantics that are also possible with xen and which are documented as the current behavior.
More or less: With current libvirt-0.9.9 you don't get what you request. The user requests "localtime" or "utc" (think about a PC in kiosk-mode, where you want the RTC to be reset), but you get "variable", where the previous offset is preserved and thus the state is not fully reset. What makes it worse is that xen changed its behaviour, but libvirt didn't notice it.
But a better idea is to represent the XML in a way where the default conversion makes sense, but where a user can explicitly change the XML to get what they want. I'm thinking:
If offset is 'utc' or 'localtime', we add a new attribute 'adjustment' ...
I'll give your approch a try, since I think this solves the problem with my STRICT.
When writing XML back out via dumpxml, libvirt would generate either the offset='utc' adjustment='reset', or the offset='variable' adjustment='nnn' basis='utc'; and would not generate offset='utc' adjustment='nnn', even though that is a valid input form.
This is the only point I (slightly) dislike, since then there would be two ways to archive the same configuration, but I think this is worth paying for the price of backward compatibility. 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/

Hello Eric, On Monday 13 February 2012 08:51:41 Philipp Hahn wrote:
On Thursday 09 February 2012 23:01:38 Eric Blake wrote: ...
But a better idea is to represent the XML in a way where the default conversion makes sense, but where a user can explicitly change the XML to get what they want. I'm thinking:
If offset is 'utc' or 'localtime', we add a new attribute 'adjustment' ...
I'll give your approch a try, since I think this solves the problem with my STRICT.
I encountered some problems while thinking more about your suggestions: 1. The problem here is that the libvirt XML parser (virDomainDefParseString()) is more or less driver agnostic and thus does not know, which variants of clock/@offset are supported by the driver: For example since for qemu the XML is used as the native format, some values are only checked when you run the domain, that is when the XML in converted to command-line arguments to kvm. So your extra @reset and @adjustment attributes need to be pased into "struct _virDomainClockDef". I see no canonical location to then convert <clock offset='utc' adjustment='42'/> to <clock offset='variable' adjustment='42' basis='utc'/> for everything but Xen-HV≥3.1, so the check / conversion has to be done for every single driver. 2. Instead of implementing a second variant of offset='variable' it would be enough to just add an attribute reset='true' (or this_is_not_from_a_buggy_libvirt_and_I_really_need_the_reset='true') to dumpxml, when a driver really implements the reset semantics. As long as it's missing, libvirt can convert it to reset='false' in the Xen≥3.1 case. With an explicit reset='true' libvirt would return an error for Xen-HV≥3.1. A more general solution would be to add a libvirt-version attribute to the XML data, which libvirt could use to implement a bug-compatibility-mode: If we're reading an old XML, treat offset='utc' as offset='variable', but if it's an XML from ≥0.9.10, return an error. (how to treat XML without an explicit version?) Yes, I know that the libvirt XML is supposed to be backward compatible, but errors happen. 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/

On 02/13/2012 03:36 AM, Philipp Hahn wrote:
Hello Eric,
On Monday 13 February 2012 08:51:41 Philipp Hahn wrote:
On Thursday 09 February 2012 23:01:38 Eric Blake wrote: ...
But a better idea is to represent the XML in a way where the default conversion makes sense, but where a user can explicitly change the XML to get what they want. I'm thinking:
If offset is 'utc' or 'localtime', we add a new attribute 'adjustment' ...
I'll give your approch a try, since I think this solves the problem with my STRICT.
I encountered some problems while thinking more about your suggestions:
1. The problem here is that the libvirt XML parser (virDomainDefParseString()) is more or less driver agnostic and thus does not know, which variants of clock/@offset are supported by the driver:
Correct - the domain_conf representation format must specify all combinations that at least one hypervisor finds useful, and hypervisor-specific code must then filter out the combinations that they do not support.
For example since for qemu the XML is used as the native format, some values are only checked when you run the domain, that is when the XML in converted to command-line arguments to kvm. So your extra @reset and @adjustment attributes need to be pased into "struct _virDomainClockDef".
Yes - that means _virDomainClockDef needs to add new fields to track the new XML; where zero-initializing the field corresponds to omitting the attribute.
I see no canonical location to then convert <clock offset='utc' adjustment='42'/> to <clock offset='variable' adjustment='42' basis='utc'/> for everything but Xen-HV≥3.1, so the check / conversion has to be done for every single driver.
Yes, this is sometimes the case with adding new XML, that we have to go back and tweak all of the drivers to cope with the new fields.
2. Instead of implementing a second variant of offset='variable' it would be enough to just add an attribute reset='true' (or this_is_not_from_a_buggy_libvirt_and_I_really_need_the_reset='true') to dumpxml, when a driver really implements the reset semantics. As long as it's missing, libvirt can convert it to reset='false' in the Xen≥3.1 case. With an explicit reset='true' libvirt would return an error for Xen-HV≥3.1.
Once we add a new attribute, we can document that domain XML that omits the attribute will default to hypervisor-specific choices (xen < 3.1 can default one way, xen >= 3.1 can default another way, and qemu can default in a particular way as well). If the user provides the attribute, then they are requesting the specific behavior that they need.
A more general solution would be to add a libvirt-version attribute to the XML data, which libvirt could use to implement a bug-compatibility-mode: If we're reading an old XML, treat offset='utc' as offset='variable', but if it's an XML from ≥0.9.10, return an error. (how to treat XML without an explicit version?)
No. We _don't_ want a libvirt version attribute. What we want is a new attribute that, if present, determines the behavior according to the user, and if absent, provides sane upgrade semantics when parsing older XML into newer libvirt.
Yes, I know that the libvirt XML is supposed to be backward compatible, but errors happen.
You still haven't managed to convince me that we cannot solve this by adding new attributes. -- Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

Hello Eric, On Monday 13 February 2012 18:43:21 Eric Blake wrote:
2. Instead of implementing a second variant of offset='variable' it would be enough to just add an attribute reset='true' (or this_is_not_from_a_buggy_libvirt_and_I_really_need_the_reset='true') to dumpxml, when a driver really implements the reset semantics. As long as it's missing, libvirt can convert it to reset='false' in the Xen≥3.1 case. With an explicit reset='true' libvirt would return an error for Xen-HV≥3.1.
Once we add a new attribute, we can document that domain XML that omits the attribute will default to hypervisor-specific choices (xen < 3.1 can default one way, xen >= 3.1 can default another way, and qemu can default in a particular way as well). If the user provides the attribute, then they are requesting the specific behavior that they need.
v3 implements this as following: adjustment='reset' forced the old behaviour with xen; xen-3.1 will reject those HV-domains. adjustment='$timeDelta' gets directly converted to offset='variable'.
No. We _don't_ want a libvirt version attribute. What we want is a new attribute that, if present, determines the behavior according to the user, and if absent, provides sane upgrade semantics when parsing older XML into newer libvirt.
Okay. Thank you for your explanation; makes sense.
You still haven't managed to convince me that we cannot solve this by adding new attributes.
I still find it a little bit strange to add an attribute to force the parser to the old behaviour of utc/localtime, which was perfectly clear. But if it improves compatibility, I'm fine with this solution. Thank you for your feedback so far. 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/
participants (2)
-
Eric Blake
-
Philipp Hahn