11ec6bd Xen: Fix <clock> handling

149 files Authored by Philipp Hahn 12 years ago, Committed by ericb 12 years ago,
149 files changed. 415 lines added. 182 lines removed.
src/xenxs/xen_sxpr.c
file modified
+137 -40
src/xenxs/xen_xm.c
file modified
+98 -25
tests/sexpr2xmldata/sexpr2xml-boot-grub.xml
file modified
+1 -1
tests/sexpr2xmldata/sexpr2xml-bridge-ipaddr.xml
file modified
+1 -1
tests/sexpr2xmldata/sexpr2xml-curmem.xml
file modified
+1 -1
tests/sexpr2xmldata/sexpr2xml-disk-block-shareable.xml
file modified
+1 -1
tests/sexpr2xmldata/sexpr2xml-disk-block.xml
file modified
+1 -1
tests/sexpr2xmldata/sexpr2xml-disk-drv-blktap-qcow.xml
file modified
+1 -1
tests/sexpr2xmldata/sexpr2xml-disk-drv-blktap-raw.xml
file modified
+1 -1
tests/sexpr2xmldata/sexpr2xml-disk-drv-blktap2-raw.xml
file modified
+1 -1
tests/sexpr2xmldata/sexpr2xml-disk-file.xml
file modified
+1 -1
tests/sexpr2xmldata/sexpr2xml-fv-autoport.xml
file modified
+1 -1
tests/sexpr2xmldata/sexpr2xml-fv-empty-kernel.xml
file modified
+1 -1
tests/sexpr2xmldata/sexpr2xml-fv-force-hpet.xml
file modified
+1 -1
tests/sexpr2xmldata/sexpr2xml-fv-force-nohpet.xml
file modified
+1 -1
tests/sexpr2xmldata/sexpr2xml-fv-kernel.xml
file modified
+1 -1
tests/sexpr2xmldata/sexpr2xml-fv-legacy-vfb.xml
file modified
+1 -1
tests/sexpr2xmldata/sexpr2xml-fv-localtime.xml
file modified
+1 -1
tests/sexpr2xmldata/sexpr2xml-fv-net-ioemu.xml
file modified
+1 -1
tests/sexpr2xmldata/sexpr2xml-fv-net-netfront.xml
file modified
+1 -1
tests/sexpr2xmldata/sexpr2xml-fv-parallel-tcp.xml
file modified
+1 -1
tests/sexpr2xmldata/sexpr2xml-fv-serial-dev-2-ports.xml
file modified
+1 -1
tests/sexpr2xmldata/sexpr2xml-fv-serial-dev-2nd-port.xml
file modified
+1 -1
tests/sexpr2xmldata/sexpr2xml-fv-serial-file.xml
file modified
+1 -1
tests/sexpr2xmldata/sexpr2xml-fv-serial-null.xml
file modified
+1 -1
tests/sexpr2xmldata/sexpr2xml-fv-serial-pipe.xml
file modified
+1 -1
tests/sexpr2xmldata/sexpr2xml-fv-serial-pty.xml
file modified
+1 -1
tests/sexpr2xmldata/sexpr2xml-fv-serial-stdio.xml
file modified
+1 -1
tests/sexpr2xmldata/sexpr2xml-fv-serial-tcp-telnet.xml
file modified
+1 -1
tests/sexpr2xmldata/sexpr2xml-fv-serial-tcp.xml
file modified
+1 -1
tests/sexpr2xmldata/sexpr2xml-fv-serial-udp.xml
file modified
+1 -1
tests/sexpr2xmldata/sexpr2xml-fv-serial-unix.xml
file modified
+1 -1
tests/sexpr2xmldata/sexpr2xml-fv-sound-all.xml
file modified
+1 -1
tests/sexpr2xmldata/sexpr2xml-fv-sound.xml
file modified
+1 -1
tests/sexpr2xmldata/sexpr2xml-fv-usbmouse.xml
file modified
+1 -1
tests/sexpr2xmldata/sexpr2xml-fv-usbtablet.xml
file modified
+1 -1
tests/sexpr2xmldata/sexpr2xml-fv-utc.xml
file modified
+1 -1
tests/sexpr2xmldata/sexpr2xml-fv-v2.xml
file modified
+1 -1
tests/sexpr2xmldata/sexpr2xml-fv.xml
file modified
+1 -1
tests/sexpr2xmldata/sexpr2xml-net-bridged.xml
file modified
+1 -1
tests/sexpr2xmldata/sexpr2xml-net-e1000.xml
file modified
+1 -1
tests/sexpr2xmldata/sexpr2xml-net-routed.xml
file modified
+1 -1
tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml
file modified
+1 -1
tests/sexpr2xmldata/sexpr2xml-pci-devs.xml
file modified
+1 -1
tests/sexpr2xmldata/sexpr2xml-pv-bootloader-cmdline.xml
file modified
+1 -1
tests/sexpr2xmldata/sexpr2xml-pv-bootloader.xml
file modified
+1 -1
tests/sexpr2xmldata/sexpr2xml-pv-localtime.xml
file modified
+1 -1
tests/sexpr2xmldata/sexpr2xml-pv-vcpus.xml
file modified
+1 -1
tests/sexpr2xmldata/sexpr2xml-pv-vfb-new-vncdisplay.xml
file modified
+1 -1
tests/sexpr2xmldata/sexpr2xml-pv-vfb-new.xml
file modified
+1 -1
tests/sexpr2xmldata/sexpr2xml-pv-vfb-orig.xml
file modified
+1 -1
tests/sexpr2xmldata/sexpr2xml-pv-vfb-type-crash.xml
file modified
+1 -1
tests/sexpr2xmldata/sexpr2xml-pv.xml
file modified
+1 -1
tests/xmconfigdata/sexpr2xml-pv-bootloader.cfg
file modified
+1 -0
tests/xmconfigdata/test-escape-paths.xml
file modified
+1 -1
tests/xmconfigdata/test-fullvirt-force-hpet.cfg
file modified
+1 -1
tests/xmconfigdata/test-fullvirt-force-hpet.xml
file modified
+1 -1
tests/xmconfigdata/test-fullvirt-force-nohpet.cfg
file modified
+1 -1
tests/xmconfigdata/test-fullvirt-force-nohpet.xml
file modified
+1 -1
tests/xmconfigdata/test-fullvirt-localtime.xml
file modified
+1 -1
tests/xmconfigdata/test-fullvirt-net-ioemu.xml
file modified
+1 -1
tests/xmconfigdata/test-fullvirt-net-netfront.xml
file modified
+1 -1
tests/xmconfigdata/test-fullvirt-new-cdrom.xml
file modified
+1 -1
tests/xmconfigdata/test-fullvirt-old-cdrom.cfg
file modified
+1 -1
tests/xmconfigdata/test-fullvirt-old-cdrom.xml
file modified
+1 -1
tests/xmconfigdata/test-fullvirt-parallel-tcp.xml
file modified
+1 -1
tests/xmconfigdata/test-fullvirt-serial-dev-2-ports.xml
file modified
+1 -1
tests/xmconfigdata/test-fullvirt-serial-dev-2nd-port.xml
file modified
+1 -1
tests/xmconfigdata/test-fullvirt-serial-file.xml
file modified
+1 -1
tests/xmconfigdata/test-fullvirt-serial-null.xml
file modified
+1 -1
tests/xmconfigdata/test-fullvirt-serial-pipe.xml
file modified
+1 -1
tests/xmconfigdata/test-fullvirt-serial-pty.xml
file modified
+1 -1
tests/xmconfigdata/test-fullvirt-serial-stdio.xml
file modified
+1 -1
tests/xmconfigdata/test-fullvirt-serial-tcp-telnet.xml
file modified
+1 -1
tests/xmconfigdata/test-fullvirt-serial-tcp.xml
file modified
+1 -1
tests/xmconfigdata/test-fullvirt-serial-udp.xml
file modified
+1 -1
tests/xmconfigdata/test-fullvirt-serial-unix.xml
file modified
+1 -1
tests/xmconfigdata/test-fullvirt-sound.xml
file modified
+1 -1
tests/xmconfigdata/test-fullvirt-usbmouse.xml
file modified
+1 -1
tests/xmconfigdata/test-fullvirt-usbtablet-no-bus.xml
file modified
+1 -1
tests/xmconfigdata/test-fullvirt-usbtablet.xml
file modified
+1 -1
tests/xmconfigdata/test-fullvirt-utc.xml
file modified
+1 -1
tests/xmconfigdata/test-no-source-cdrom.xml
file modified
+1 -1
tests/xmconfigdata/test-paravirt-net-e1000.cfg
file modified
+1 -0
tests/xmconfigdata/test-paravirt-net-e1000.xml
file modified
+1 -1
tests/xmconfigdata/test-paravirt-net-vifname.cfg
file modified
+1 -0
tests/xmconfigdata/test-paravirt-net-vifname.xml
file modified
+1 -1
tests/xmconfigdata/test-paravirt-new-pvfb-vncdisplay.cfg
file modified
+1 -0
tests/xmconfigdata/test-paravirt-new-pvfb-vncdisplay.xml
file modified
+1 -1
tests/xmconfigdata/test-paravirt-new-pvfb.cfg
file modified
+1 -0
tests/xmconfigdata/test-paravirt-new-pvfb.xml
file modified
+1 -1
tests/xmconfigdata/test-paravirt-old-pvfb-vncdisplay.cfg
file modified
+1 -0
tests/xmconfigdata/test-paravirt-old-pvfb-vncdisplay.xml
file modified
+1 -1
tests/xmconfigdata/test-paravirt-old-pvfb.cfg
file modified
+1 -0
tests/xmconfigdata/test-paravirt-old-pvfb.xml
file modified
+1 -1
tests/xmconfigdata/test-paravirt-vcpu.cfg
file modified
+1 -0
tests/xmconfigdata/test-paravirt-vcpu.xml
file modified
+1 -1
tests/xmconfigdata/test-pci-devs.xml
file modified
+1 -1
tests/xml2sexprdata/xml2sexpr-boot-grub.sexpr
file modified
+1 -0
tests/xml2sexprdata/xml2sexpr-bridge-ipaddr.sexpr
file modified
+3 -1
tests/xml2sexprdata/xml2sexpr-curmem.sexpr
file modified
+1 -0
tests/xml2sexprdata/xml2sexpr-disk-block-shareable.sexpr
file modified
+3 -1
tests/xml2sexprdata/xml2sexpr-disk-block.sexpr
file modified
+3 -1
tests/xml2sexprdata/xml2sexpr-disk-drv-blkback.sexpr
file modified
+3 -1
tests/xml2sexprdata/xml2sexpr-disk-drv-blktap-qcow.sexpr
file modified
+3 -1
tests/xml2sexprdata/xml2sexpr-disk-drv-blktap-raw.sexpr
file modified
+3 -1
tests/xml2sexprdata/xml2sexpr-disk-drv-blktap.sexpr
file modified
+3 -1
tests/xml2sexprdata/xml2sexpr-disk-drv-blktap2-raw.sexpr
file modified
+3 -1
tests/xml2sexprdata/xml2sexpr-disk-drv-blktap2.sexpr
file modified
+3 -1
tests/xml2sexprdata/xml2sexpr-disk-drv-loop.sexpr
file modified
+3 -1
tests/xml2sexprdata/xml2sexpr-disk-file.sexpr
file modified
+3 -1
tests/xml2sexprdata/xml2sexpr-escape.sexpr
file modified
+1 -0
tests/xml2sexprdata/xml2sexpr-fv-force-hpet.sexpr
file modified
+1 -0
tests/xml2sexprdata/xml2sexpr-fv-force-nohpet.sexpr
file modified
+1 -0
tests/xml2sexprdata/xml2sexpr-fv-kernel.sexpr
file modified
+1 -0
tests/xml2sexprdata/xml2sexpr-fv-localtime.sexpr
file modified
+3 -2
tests/xml2sexprdata/xml2sexpr-fv-net-ioemu.sexpr
file modified
+2 -1
tests/xml2sexprdata/xml2sexpr-fv-net-netfront.sexpr
file modified
+2 -1
tests/xml2sexprdata/xml2sexpr-fv-parallel-tcp.sexpr
file modified
+1 -0
tests/xml2sexprdata/xml2sexpr-fv-serial-dev-2-ports.sexpr
file modified
+2 -1
tests/xml2sexprdata/xml2sexpr-fv-serial-dev-2nd-port.sexpr
file modified
+1 -0
tests/xml2sexprdata/xml2sexpr-fv-serial-file.sexpr
file modified
+2 -1
tests/xml2sexprdata/xml2sexpr-fv-serial-null.sexpr
file modified
+1 -0
tests/xml2sexprdata/xml2sexpr-fv-serial-pipe.sexpr
file modified
+2 -1
tests/xml2sexprdata/xml2sexpr-fv-serial-pty.sexpr
file modified
+1 -0
tests/xml2sexprdata/xml2sexpr-fv-serial-stdio.sexpr
file modified
+1 -0
tests/xml2sexprdata/xml2sexpr-fv-serial-tcp-telnet.sexpr
file modified
+1 -0
tests/xml2sexprdata/xml2sexpr-fv-serial-tcp.sexpr
file modified
+1 -0
tests/xml2sexprdata/xml2sexpr-fv-serial-udp.sexpr
file modified
+1 -0
tests/xml2sexprdata/xml2sexpr-fv-serial-unix.sexpr
file modified
+1 -0
tests/xml2sexprdata/xml2sexpr-fv-sound.sexpr
file modified
+1 -0
tests/xml2sexprdata/xml2sexpr-fv-usbmouse.sexpr
file modified
+1 -0
tests/xml2sexprdata/xml2sexpr-fv-usbtablet.sexpr
file modified
+2 -1
tests/xml2sexprdata/xml2sexpr-fv-utc.sexpr
file modified
+1 -0
tests/xml2sexprdata/xml2sexpr-fv-v2.sexpr
file modified
+1 -0
tests/xml2sexprdata/xml2sexpr-fv-vncunused.sexpr
file modified
+2 -1
tests/xml2sexprdata/xml2sexpr-fv.sexpr
file modified
+1 -0
tests/xml2sexprdata/xml2sexpr-net-bridged.sexpr
file modified
+1 -1
tests/xml2sexprdata/xml2sexpr-net-e1000.sexpr
file modified
+1 -1
tests/xml2sexprdata/xml2sexpr-net-routed.sexpr
file modified
+1 -1
tests/xml2sexprdata/xml2sexpr-no-source-cdrom.sexpr
file modified
+1 -0
tests/xml2sexprdata/xml2sexpr-pci-devs.sexpr
file modified
+1 -1
tests/xml2sexprdata/xml2sexpr-pv-bootloader-cmdline.sexpr
file modified
+1 -0
tests/xml2sexprdata/xml2sexpr-pv-bootloader.sexpr
file modified
+3 -1
tests/xml2sexprdata/xml2sexpr-pv-vcpus.sexpr
file modified
+1 -1
tests/xml2sexprdata/xml2sexpr-pv-vfb-new-auto.sexpr
file modified
+1 -1
tests/xml2sexprdata/xml2sexpr-pv-vfb-new.sexpr
file modified
+1 -1
tests/xml2sexprdata/xml2sexpr-pv-vfb-orig.sexpr
file modified
+1 -0
tests/xml2sexprdata/xml2sexpr-pv.sexpr
file modified
+1 -1
    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>
    
        
file modified
+137 -40
file modified
+98 -25