libvirt/tests/sexpr2xmldata
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
..
sexpr2xml-boot-grub.sexpr maint: avoid long lines in more tests 2011-03-03 07:45:31 -07:00
sexpr2xml-boot-grub.xml Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
sexpr2xml-bridge-ipaddr.sexpr maint: avoid long lines in more tests 2011-03-03 07:45:31 -07:00
sexpr2xml-bridge-ipaddr.xml Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
sexpr2xml-curmem.sexpr * src/xend_internal.c src/xml.c: add an extra element currentMemory 2006-11-10 11:13:01 +00:00
sexpr2xml-curmem.xml Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
sexpr2xml-disk-block-shareable.sexpr maint: avoid long lines in more tests 2011-03-03 07:45:31 -07:00
sexpr2xml-disk-block-shareable.xml Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
sexpr2xml-disk-block.sexpr maint: avoid long lines in more tests 2011-03-03 07:45:31 -07:00
sexpr2xml-disk-block.xml Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
sexpr2xml-disk-drv-blktap2-raw.sexpr maint: avoid long lines in more tests 2011-03-03 07:45:31 -07:00
sexpr2xml-disk-drv-blktap2-raw.xml Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
sexpr2xml-disk-drv-blktap-qcow.sexpr maint: avoid long lines in more tests 2011-03-03 07:45:31 -07:00
sexpr2xml-disk-drv-blktap-qcow.xml Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
sexpr2xml-disk-drv-blktap-raw.sexpr maint: avoid long lines in more tests 2011-03-03 07:45:31 -07:00
sexpr2xml-disk-drv-blktap-raw.xml Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
sexpr2xml-disk-file.sexpr maint: avoid long lines in more tests 2011-03-03 07:45:31 -07:00
sexpr2xml-disk-file.xml Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
sexpr2xml-fv-autoport.sexpr add missing files 2009-01-29 17:14:48 +00:00
sexpr2xml-fv-autoport.xml Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
sexpr2xml-fv-empty-kernel.sexpr xen_xs: Guard against set but empty kernel argument 2011-10-10 22:58:04 +02:00
sexpr2xml-fv-empty-kernel.xml Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
sexpr2xml-fv-force-hpet.sexpr xen: parse and generate hpet item in sxpr 2011-05-10 16:16:55 -06:00
sexpr2xml-fv-force-hpet.xml Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
sexpr2xml-fv-force-nohpet.sexpr xen: parse and generate hpet item in sxpr 2011-05-10 16:16:55 -06:00
sexpr2xml-fv-force-nohpet.xml Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
sexpr2xml-fv-kernel.sexpr maint: avoid long lines in more tests 2011-03-03 07:45:31 -07:00
sexpr2xml-fv-kernel.xml Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
sexpr2xml-fv-legacy-vfb.sexpr Added support for booting off kenrel+initrd with HVM guests 2008-02-05 16:21:25 +00:00
sexpr2xml-fv-legacy-vfb.xml Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
sexpr2xml-fv-localtime.sexpr maint: avoid long lines in more tests 2011-03-03 07:45:31 -07:00
sexpr2xml-fv-localtime.xml Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
sexpr2xml-fv-net-ioemu.sexpr maint: avoid long lines in more tests 2011-03-03 07:45:31 -07:00
sexpr2xml-fv-net-ioemu.xml Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
sexpr2xml-fv-net-netfront.sexpr maint: avoid long lines in more tests 2011-03-03 07:45:31 -07:00
sexpr2xml-fv-net-netfront.xml Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
sexpr2xml-fv-parallel-tcp.sexpr maint: avoid long lines in more tests 2011-03-03 07:45:31 -07:00
sexpr2xml-fv-parallel-tcp.xml Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
sexpr2xml-fv-serial-dev-2-ports.sexpr maint: avoid long lines in more tests 2011-03-03 07:45:31 -07:00
sexpr2xml-fv-serial-dev-2-ports.xml Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
sexpr2xml-fv-serial-dev-2nd-port.sexpr maint: avoid long lines in more tests 2011-03-03 07:45:31 -07:00
sexpr2xml-fv-serial-dev-2nd-port.xml Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
sexpr2xml-fv-serial-file.sexpr maint: avoid long lines in more tests 2011-03-03 07:45:31 -07:00
sexpr2xml-fv-serial-file.xml Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
sexpr2xml-fv-serial-null.sexpr maint: avoid long lines in more tests 2011-03-03 07:45:31 -07:00
sexpr2xml-fv-serial-null.xml Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
sexpr2xml-fv-serial-pipe.sexpr maint: avoid long lines in more tests 2011-03-03 07:45:31 -07:00
sexpr2xml-fv-serial-pipe.xml Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
sexpr2xml-fv-serial-pty.sexpr maint: avoid long lines in more tests 2011-03-03 07:45:31 -07:00
sexpr2xml-fv-serial-pty.xml Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
sexpr2xml-fv-serial-stdio.sexpr maint: avoid long lines in more tests 2011-03-03 07:45:31 -07:00
sexpr2xml-fv-serial-stdio.xml Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
sexpr2xml-fv-serial-tcp-telnet.sexpr maint: avoid long lines in more tests 2011-03-03 07:45:31 -07:00
sexpr2xml-fv-serial-tcp-telnet.xml Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
sexpr2xml-fv-serial-tcp.sexpr maint: avoid long lines in more tests 2011-03-03 07:45:31 -07:00
sexpr2xml-fv-serial-tcp.xml Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
sexpr2xml-fv-serial-udp.sexpr maint: avoid long lines in more tests 2011-03-03 07:45:31 -07:00
sexpr2xml-fv-serial-udp.xml Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
sexpr2xml-fv-serial-unix.sexpr maint: avoid long lines in more tests 2011-03-03 07:45:31 -07:00
sexpr2xml-fv-serial-unix.xml Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
sexpr2xml-fv-sound-all.sexpr maint: avoid long lines in more tests 2011-03-03 07:45:31 -07:00
sexpr2xml-fv-sound-all.xml Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
sexpr2xml-fv-sound.sexpr maint: avoid long lines in more tests 2011-03-03 07:45:31 -07:00
sexpr2xml-fv-sound.xml Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
sexpr2xml-fv-usbmouse.sexpr maint: avoid long lines in more tests 2011-03-03 07:45:31 -07:00
sexpr2xml-fv-usbmouse.xml Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
sexpr2xml-fv-usbtablet.sexpr maint: avoid long lines in more tests 2011-03-03 07:45:31 -07:00
sexpr2xml-fv-usbtablet.xml Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
sexpr2xml-fv-utc.sexpr maint: avoid long lines in more tests 2011-03-03 07:45:31 -07:00
sexpr2xml-fv-utc.xml Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
sexpr2xml-fv-v2.sexpr maint: avoid long lines in more tests 2011-03-03 07:45:31 -07:00
sexpr2xml-fv-v2.xml Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
sexpr2xml-fv.sexpr maint: avoid long lines in more tests 2011-03-03 07:45:31 -07:00
sexpr2xml-fv.xml Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
sexpr2xml-net-bridged.sexpr maint: avoid long lines in more tests 2011-03-03 07:45:31 -07:00
sexpr2xml-net-bridged.xml Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
sexpr2xml-net-e1000.sexpr maint: avoid long lines in more tests 2011-03-03 07:45:31 -07:00
sexpr2xml-net-e1000.xml Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
sexpr2xml-net-routed.sexpr maint: avoid long lines in more tests 2011-03-03 07:45:31 -07:00
sexpr2xml-net-routed.xml Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
sexpr2xml-no-source-cdrom.sexpr * src/xend_internal.c src/xml.c: applied patch from Nobuhiro Itou 2007-04-11 16:06:30 +00:00
sexpr2xml-no-source-cdrom.xml Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
sexpr2xml-pci-devs.sexpr maint: avoid long lines in more tests 2011-03-03 07:45:31 -07:00
sexpr2xml-pci-devs.xml Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
sexpr2xml-pv-bootloader-cmdline.sexpr Do not drop kernel cmdline for xen pv domains 2011-07-11 09:11:15 -06:00
sexpr2xml-pv-bootloader-cmdline.xml Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
sexpr2xml-pv-bootloader.sexpr maint: avoid long lines in more tests 2011-03-03 07:45:31 -07:00
sexpr2xml-pv-bootloader.xml Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
sexpr2xml-pv-localtime.sexpr maint: avoid long lines in more tests 2011-03-03 07:45:31 -07:00
sexpr2xml-pv-localtime.xml Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
sexpr2xml-pv-vcpus.sexpr maint: avoid long lines in more tests 2011-03-03 07:45:31 -07:00
sexpr2xml-pv-vcpus.xml Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
sexpr2xml-pv-vfb-new-vncdisplay.sexpr maint: avoid long lines in more tests 2011-03-03 07:45:31 -07:00
sexpr2xml-pv-vfb-new-vncdisplay.xml Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
sexpr2xml-pv-vfb-new.sexpr maint: avoid long lines in more tests 2011-03-03 07:45:31 -07:00
sexpr2xml-pv-vfb-new.xml Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
sexpr2xml-pv-vfb-orig.sexpr maint: avoid long lines in more tests 2011-03-03 07:45:31 -07:00
sexpr2xml-pv-vfb-orig.xml Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
sexpr2xml-pv-vfb-type-crash.sexpr Add test for recently fixed crash with latest XenD 2009-08-19 17:44:50 +01:00
sexpr2xml-pv-vfb-type-crash.xml Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
sexpr2xml-pv.sexpr maint: avoid long lines in more tests 2011-03-03 07:45:31 -07:00
sexpr2xml-pv.xml Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00