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

Philipp Hahn hahn at univention.de
Thu Feb 9 11:36:16 UTC 2012


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(-)




More information about the libvir-list mailing list