libvirt/tests/xml2sexprdata
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
..
xml2sexpr-boot-grub.sexpr Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
xml2sexpr-boot-grub.xml xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
xml2sexpr-bridge-ipaddr.sexpr Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
xml2sexpr-bridge-ipaddr.xml xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
xml2sexpr-curmem.sexpr Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
xml2sexpr-curmem.xml xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
xml2sexpr-disk-block-shareable.sexpr Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
xml2sexpr-disk-block-shareable.xml xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
xml2sexpr-disk-block.sexpr Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
xml2sexpr-disk-block.xml xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
xml2sexpr-disk-drv-blkback.sexpr Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
xml2sexpr-disk-drv-blkback.xml xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
xml2sexpr-disk-drv-blktap-qcow.sexpr Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
xml2sexpr-disk-drv-blktap-qcow.xml xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
xml2sexpr-disk-drv-blktap-raw.sexpr Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
xml2sexpr-disk-drv-blktap-raw.xml xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
xml2sexpr-disk-drv-blktap.sexpr Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
xml2sexpr-disk-drv-blktap.xml xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
xml2sexpr-disk-drv-blktap2-raw.sexpr Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
xml2sexpr-disk-drv-blktap2-raw.xml xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
xml2sexpr-disk-drv-blktap2.sexpr Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
xml2sexpr-disk-drv-blktap2.xml xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
xml2sexpr-disk-drv-loop.sexpr Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
xml2sexpr-disk-drv-loop.xml xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
xml2sexpr-disk-file.sexpr Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
xml2sexpr-disk-file.xml xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
xml2sexpr-escape.sexpr Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
xml2sexpr-escape.xml xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
xml2sexpr-fv-force-hpet.sexpr Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
xml2sexpr-fv-force-hpet.xml xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
xml2sexpr-fv-force-nohpet.sexpr Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
xml2sexpr-fv-force-nohpet.xml xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
xml2sexpr-fv-kernel.sexpr Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
xml2sexpr-fv-kernel.xml xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
xml2sexpr-fv-localtime.sexpr Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
xml2sexpr-fv-localtime.xml xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
xml2sexpr-fv-net-ioemu.sexpr Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
xml2sexpr-fv-net-ioemu.xml xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
xml2sexpr-fv-net-netfront.sexpr Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
xml2sexpr-fv-net-netfront.xml xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
xml2sexpr-fv-parallel-tcp.sexpr Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
xml2sexpr-fv-parallel-tcp.xml xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
xml2sexpr-fv-serial-dev-2-ports.sexpr Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
xml2sexpr-fv-serial-dev-2-ports.xml xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
xml2sexpr-fv-serial-dev-2nd-port.sexpr Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
xml2sexpr-fv-serial-dev-2nd-port.xml xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
xml2sexpr-fv-serial-file.sexpr Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
xml2sexpr-fv-serial-file.xml xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
xml2sexpr-fv-serial-null.sexpr Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
xml2sexpr-fv-serial-null.xml xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
xml2sexpr-fv-serial-pipe.sexpr Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
xml2sexpr-fv-serial-pipe.xml xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
xml2sexpr-fv-serial-pty.sexpr Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
xml2sexpr-fv-serial-pty.xml xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
xml2sexpr-fv-serial-stdio.sexpr Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
xml2sexpr-fv-serial-stdio.xml xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
xml2sexpr-fv-serial-tcp-telnet.sexpr Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
xml2sexpr-fv-serial-tcp-telnet.xml xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
xml2sexpr-fv-serial-tcp.sexpr Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
xml2sexpr-fv-serial-tcp.xml xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
xml2sexpr-fv-serial-udp.sexpr Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
xml2sexpr-fv-serial-udp.xml xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
xml2sexpr-fv-serial-unix.sexpr Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
xml2sexpr-fv-serial-unix.xml xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
xml2sexpr-fv-sound.sexpr Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
xml2sexpr-fv-sound.xml xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
xml2sexpr-fv-usbmouse.sexpr Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
xml2sexpr-fv-usbmouse.xml xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
xml2sexpr-fv-usbtablet.sexpr Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
xml2sexpr-fv-usbtablet.xml xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
xml2sexpr-fv-utc.sexpr Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
xml2sexpr-fv-utc.xml xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
xml2sexpr-fv-v2.sexpr Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
xml2sexpr-fv-vncunused.sexpr Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
xml2sexpr-fv-vncunused.xml xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
xml2sexpr-fv.sexpr Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
xml2sexpr-fv.xml xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
xml2sexpr-net-bridged.sexpr Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
xml2sexpr-net-bridged.xml xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
xml2sexpr-net-e1000.sexpr Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
xml2sexpr-net-e1000.xml xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
xml2sexpr-net-routed.sexpr Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
xml2sexpr-net-routed.xml xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
xml2sexpr-no-source-cdrom.sexpr Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
xml2sexpr-no-source-cdrom.xml xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
xml2sexpr-pci-devs.sexpr Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
xml2sexpr-pci-devs.xml xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
xml2sexpr-pv-bootloader-cmdline.sexpr Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
xml2sexpr-pv-bootloader-cmdline.xml xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
xml2sexpr-pv-bootloader.sexpr Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
xml2sexpr-pv-bootloader.xml xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
xml2sexpr-pv-localtime.sexpr maint: avoid long lines in more tests 2011-03-03 07:45:31 -07:00
xml2sexpr-pv-localtime.xml xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
xml2sexpr-pv-vcpus.sexpr Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
xml2sexpr-pv-vcpus.xml xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
xml2sexpr-pv-vfb-new-auto.sexpr Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
xml2sexpr-pv-vfb-new-auto.xml xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
xml2sexpr-pv-vfb-new.sexpr Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
xml2sexpr-pv-vfb-new.xml xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
xml2sexpr-pv-vfb-orig.sexpr Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
xml2sexpr-pv-vfb-orig.xml xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
xml2sexpr-pv.sexpr Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
xml2sexpr-pv.xml xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00