libvirt/tests
Philipp Hahn 11ec6bd891 Xen: Fix <clock> handling
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.
This behaviour can be turned off by adding the additional attribute
adjustment='reset', in which case libvirt will report an error instead
of doing the conversion. The attribute can also be used as a shortcut to
offset='variable' with basis='...'.

With these changes, it is also necessary to adjust the xen tests:

"localtime = 0" is always inserted, because otherwise on updates the
value is not changed within XenD.

adjustment='reset' is inserted for all cases, since they're all <
XEND_CONFIG_VERSION_3_1_0, only 3.1 introduced persistent
rtc_timeoffset.

Some statements change their order because code was moved around.

Signed-off-by: Philipp Hahn <hahn@univention.de>
2012-04-02 09:33:54 -06:00
..
capabilityschemadata microblaze: Add architecture support 2011-07-07 17:49:21 -06:00
commanddata command: handle empty buffer argument correctly 2011-12-03 15:55:46 -07:00
confdata Change the default of mdns_adv to false 2012-03-27 09:54:49 -06:00
cputestdata Removed more AMD-specific features from cpu64-rhel* models 2012-03-09 14:36:31 +01:00
domainschemadata xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
domainsnapshotxml2xmlin snapshot: also support disks by path 2011-09-05 07:03:04 -06:00
domainsnapshotxml2xmlout qemu: Support numad 2012-03-15 12:24:56 +08:00
interfaceschemadata Update interface.rng and xml test files to match netcf 0.1.5 2010-01-19 21:13:03 +01:00
lxcxml2xmldata Add support for setting init argv for LXC 2012-03-27 15:52:25 +01:00
networkxml2argvdata tests: dynamically replace dnsmasq path 2012-02-01 17:02:45 -07:00
networkxml2xmlin Adding the element pf to network xml. 2012-01-11 13:10:21 -07:00
networkxml2xmlout Adding the element pf to network xml. 2012-01-11 13:10:21 -07:00
nodedevschemadata nodedev: Add removable storage 'media_label' prop 2009-12-14 14:58:23 +01:00
nodeinfodata Modify the tests/nodeinfotest.c to use sysfs in addition 2011-12-08 08:39:26 -05:00
nwfilterxml2xmlin Add test cases for new ways to access variables in filters 2012-01-11 06:42:37 -05:00
nwfilterxml2xmlout Add test cases for new ways to access variables in filters 2012-01-11 06:42:37 -05:00
qemuhelpdata Add support for QEMU 1.0 2011-12-05 13:02:54 +01:00
qemuxml2argvdata Support clock=variable relative to localtime 2012-04-02 09:08:31 -06:00
qemuxml2xmloutdata qemu: Support numad 2012-03-15 12:24:56 +08:00
qemuxmlnsdata xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
sexpr2xmldata Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
storagepoolxml2xmlin storage: add support for Vendor and Model in XML 2010-08-19 15:58:43 -06:00
storagepoolxml2xmlout xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
storagevolxml2xmlin storage: support more scaling suffixes 2012-03-07 18:24:43 -07:00
storagevolxml2xmlout xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
vmx2xmldata xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
xencapsdata Add suspend info to Xen, LXC and UML hypervisor capabilities 2011-11-30 10:12:30 +00:00
xmconfigdata Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
xml2sexprdata Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
xml2vmxdata xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
.valgrind.supp tests: suppress more valgrind situations 2011-05-03 08:03:39 -06:00
capabilityschematest Make test suite output less verbose 2010-01-15 16:28:05 +00:00
commandhelper.c Disable build of commandhelper & ssh on Win32 2012-03-30 11:47:14 +01:00
commandtest.c Cleanup for a return statement in source files 2012-03-26 14:45:22 -06:00
conftest.c tests: Lower stack usage below 4096 bytes 2011-04-30 19:59:52 +02:00
cpuset tests: use GPLv2+, not GPLv3 2010-05-12 08:41:10 +02:00
cputest.c Don't redefine the CPU comparison constants in CPU test 2012-03-30 11:47:04 +01:00
daemon-conf tests: fix daemon-conf testing failure 2010-11-03 11:43:11 +01:00
define-dev-segfault xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
domainschematest Add LXC XML files to schema test & fix problems this uncovers 2012-03-27 15:52:25 +01:00
domainsnapshotschematest Domain snapshot RNG and tests. 2010-05-20 13:50:03 -04:00
domainsnapshotxml2xmltest.c Cleanup for a return statement in source files 2012-03-26 14:45:22 -06:00
esxutilstest.c build: properly skip tests 2011-12-01 13:49:20 -07:00
eventtest.c tests: simplify common setup 2011-04-29 10:21:20 -06:00
int-overflow tests: Don't use bash if we don't have to 2011-07-29 17:17:21 +02:00
interfaceschematest Make test suite output less verbose 2010-01-15 16:28:05 +00:00
interfacexml2xmltest.c Cleanup for a return statement in source files 2012-03-26 14:45:22 -06:00
jsontest.c Add test case for parsing JSON docs 2011-06-30 18:04:02 +01:00
libvirtd-fail Fix up "make check" 2009-10-07 12:18:13 +02:00
libvirtd-pool Fix up "make check" 2009-10-07 12:18:13 +02:00
lxcxml2xmltest.c build: silence recent syntax check violations 2012-03-29 21:23:59 -06:00
Makefile.am Enable build of test suite programs by default for GIT checkouts 2012-03-27 17:08:06 +01:00
networkschematest Make test suite output less verbose 2010-01-15 16:28:05 +00:00
networkxml2argvtest.c Cleanup for a return statement in source files 2012-03-26 14:45:22 -06:00
networkxml2xmltest.c Cleanup for a return statement in source files 2012-03-26 14:45:22 -06:00
nodedevschematest Make test suite output less verbose 2010-01-15 16:28:05 +00:00
nodedevxml2xmltest.c Cleanup for a return statement in source files 2012-03-26 14:45:22 -06:00
nodeinfotest.c Cleanup for a return statement in source files 2012-03-26 14:45:22 -06:00
nwfilterschematest nwfilter: Add filter schema for nwfilter XML, extend domain XML schema 2010-04-06 11:09:46 -04:00
nwfilterxml2xmltest.c Cleanup for a return statement in source files 2012-03-26 14:45:22 -06:00
object-locking.ml maint: typo fixes 2011-06-24 08:01:10 -06:00
oomtrace.pl maint: mark more perl scripts executable 2011-05-16 10:12:21 -06:00
openvzutilstest.c xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
openvzutilstest.conf openvz: Add simple test for openvzReadNetworkConf 2011-06-01 11:58:15 +02:00
pkix_asn1_tab.c Add a test case for certificate validation 2011-07-22 15:18:32 +01:00
qemuargv2xmltest.c Cleanup for a return statement in source files 2012-03-26 14:45:22 -06:00
qemuhelptest.c qemu: Use scsi-block for lun passthrough instead of scsi-disk 2012-03-14 23:32:53 +08:00
qemumonitortest.c qemu: unescape HMP commands before converting them to json 2012-02-27 16:06:02 -07:00
qemuxml2argvtest.c Cleanup for a return statement in source files 2012-03-26 14:45:22 -06:00
qemuxml2xmltest.c Cleanup for a return statement in source files 2012-03-26 14:45:22 -06:00
qemuxmlnstest.c Cleanup for a return statement in source files 2012-03-26 14:45:22 -06:00
read-bufsiz build: use portable sed expressions 2010-09-14 08:42:10 -06:00
read-non-seekable tests: use GPLv2+, not GPLv3 2010-05-12 08:41:10 +02:00
reconnect.c tests: avoid xend ABRT crash report 2011-11-18 15:00:18 -07:00
schematestutils.sh tests: fix schema checks sorting 2011-12-22 13:01:09 -07:00
seclabeltest.c security: Driver 'none' cannot create confined guests 2012-02-08 11:55:56 +01:00
sexpr2xmltest.c Consistent style for usage of sizeof operator 2012-03-30 11:47:24 +01:00
shunloadhelper.c Prevent crash from dlclose() of libvirt.so 2011-09-16 15:51:31 -06:00
shunloadtest.c build: properly skip tests 2011-12-01 13:49:20 -07:00
sockettest.c Cleanup for a return statement in source files 2012-03-26 14:45:22 -06:00
ssh.c Disable build of commandhelper & ssh on Win32 2012-03-30 11:47:14 +01:00
start tests: use GPLv2+, not GPLv3 2010-05-12 08:41:10 +02:00
statstest.c Cleanup for a return statement in source files 2012-03-26 14:45:22 -06:00
storagepoolschematest Make test suite output less verbose 2010-01-15 16:28:05 +00:00
storagepoolxml2xmltest.c Cleanup for a return statement in source files 2012-03-26 14:45:22 -06:00
storagevolschematest Make test suite output less verbose 2010-01-15 16:28:05 +00:00
storagevolxml2xmltest.c Cleanup for a return statement in source files 2012-03-26 14:45:22 -06:00
test_conf.sh Make test suite output less verbose 2010-01-15 16:28:05 +00:00
test-lib.sh tests: simplify formatting 2011-07-11 09:21:37 -06:00
testutils.c build: use correct type for pid and similar types 2012-03-02 06:57:43 -07:00
testutils.h build: expand rule to cover testsuite 2012-02-03 10:41:46 -07:00
testutilslxc.c Add support for setting init argv for LXC 2012-03-27 15:52:25 +01:00
testutilslxc.h Add support for setting init argv for LXC 2012-03-27 15:52:25 +01:00
testutilsqemu.c Add support for cpu mode attribute 2012-01-17 11:39:23 +01:00
testutilsqemu.h remove all trailing blank lines 2009-07-16 15:06:42 +02:00
testutilsxen.c Fix default console type setting 2011-11-03 12:01:48 +00:00
testutilsxen.h remove all trailing blank lines 2009-07-16 15:06:42 +02:00
undefine virsh: properly interleave shared stdout and stderr 2011-08-19 09:22:22 -06:00
utiltest.c build: avoid 'make syntax-check' failure 2011-07-01 16:46:20 -06:00
vcpupin tests: use GPLv2+, not GPLv3 2010-05-12 08:41:10 +02:00
virauthconfigtest.c Cleanup for a return statement in source files 2012-03-26 14:45:22 -06:00
virbuftest.c Cleanup for a return statement in source files 2012-03-26 14:45:22 -06:00
virhashdata.h Rename hash.h and hash.c to virhash.h and virhash.c 2012-01-26 14:11:13 +00:00
virhashtest.c Rename hash.h and hash.c to virhash.h and virhash.c 2012-01-26 14:11:13 +00:00
virkeyfiletest.c Cleanup for a return statement in source files 2012-03-26 14:45:22 -06:00
virnetmessagetest.c Cleanup for a return statement in source files 2012-03-26 14:45:22 -06:00
virnetsockettest.c Consistent style for usage of sizeof operator 2012-03-30 11:47:24 +01:00
virnettlscontexttest.c Cleanup for a return statement in source files 2012-03-26 14:45:22 -06:00
virsh-all tests: use GPLv2+, not GPLv3 2010-05-12 08:41:10 +02:00
virsh-optparse build: update to latest gnulib 2011-12-01 14:12:59 -07:00
virsh-schedinfo build: update to latest gnulib 2011-12-01 14:12:59 -07:00
virsh-synopsis tests: use GPLv2+, not GPLv3 2010-05-12 08:41:10 +02:00
virshtest.c Cleanup for a return statement in source files 2012-03-26 14:45:22 -06:00
virt-aa-helper-test fix AppArmor driver for pipe character devices 2011-09-28 15:43:39 +08:00
virtimetest.c Cleanup for a return statement in source files 2012-03-26 14:45:22 -06:00
viruritest.c Cleanup for a return statement in source files 2012-03-26 14:45:22 -06:00
vmx2xmltest.c vmx: Better Workstation vmx handling 2012-02-24 11:53:23 +01:00
xencapstest.c Cleanup for a return statement in source files 2012-03-26 14:45:22 -06:00
xmconfigtest.c Cleanup for a return statement in source files 2012-03-26 14:45:22 -06:00
xml2sexprtest.c Cleanup for a return statement in source files 2012-03-26 14:45:22 -06:00
xml2vmxtest.c vmx: Better Workstation vmx handling 2012-02-24 11:53:23 +01:00