[libvirt] [PATCH] tests: Add qemu test for multiple timers

Cole Robinson crobinso at redhat.com
Tue Oct 8 21:43:42 UTC 2013


The following XML is the recommended default clock configuration for
qemu:

  <clock offset='utc'>
    <timer name='rtc' tickpolicy='catchup'/>
    <timer name='pit' tickpolicy='delay'/>
    <timer name='hpet' present='no'/>
  </clock>

However we weren't testing any of those timer elements.
---
 .../qemuxml2argv-clock-hpet-off.args               |  5 ++++
 .../qemuxml2argv-clock-hpet-off.xml                | 30 ++++++++++++++++++++++
 tests/qemuxml2argvtest.c                           |  2 ++
 3 files changed, 37 insertions(+)
 create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-clock-hpet-off.args
 create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-clock-hpet-off.xml

diff --git a/tests/qemuxml2argvdata/qemuxml2argv-clock-hpet-off.args b/tests/qemuxml2argvdata/qemuxml2argv-clock-hpet-off.args
new file mode 100644
index 0000000..5d11d91
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-clock-hpet-off.args
@@ -0,0 +1,5 @@
+LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \
+/usr/bin/qemu -S -M \
+pc -m 214 -smp 1 -nographic -monitor unix:/tmp/test-monitor,server,nowait \
+-rtc base=utc,driftfix=slew -no-kvm-pit-reinjection -no-hpet -no-acpi -boot c \
+-usb -hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel none
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-clock-hpet-off.xml b/tests/qemuxml2argvdata/qemuxml2argv-clock-hpet-off.xml
new file mode 100644
index 0000000..3aed49f
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-clock-hpet-off.xml
@@ -0,0 +1,30 @@
+<domain type='qemu'>
+  <name>QEMUGuest1</name>
+  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+  <memory unit='KiB'>219100</memory>
+  <currentMemory unit='KiB'>219100</currentMemory>
+  <vcpu placement='static'>1</vcpu>
+  <os>
+    <type arch='i686' machine='pc'>hvm</type>
+    <boot dev='hd'/>
+  </os>
+  <clock offset='utc'>
+    <timer name='rtc' tickpolicy='catchup'/>
+    <timer name='pit' tickpolicy='delay'/>
+    <timer name='hpet' present='no'/>
+  </clock>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>destroy</on_crash>
+  <devices>
+    <emulator>/usr/bin/qemu</emulator>
+    <disk type='block' device='disk'>
+      <source dev='/dev/HostVG/QEMUGuest1'/>
+      <target dev='hda' bus='ide'/>
+      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
+    </disk>
+    <controller type='usb' index='0'/>
+    <controller type='ide' index='0'/>
+    <memballoon model='virtio'/>
+  </devices>
+</domain>
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 58165fd..286f1a3 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -421,6 +421,8 @@ mymain(void)
     DO_TEST("clock-variable", QEMU_CAPS_RTC);
     */
     DO_TEST("clock-france", QEMU_CAPS_RTC);
+    DO_TEST("clock-hpet-off", QEMU_CAPS_RTC, QEMU_CAPS_NO_HPET,
+            QEMU_CAPS_NO_KVM_PIT);
     DO_TEST("cpu-kvmclock", QEMU_CAPS_ENABLE_KVM);
     DO_TEST("cpu-host-kvmclock", QEMU_CAPS_ENABLE_KVM, QEMU_CAPS_CPU_HOST);
     DO_TEST("kvmclock", QEMU_CAPS_KVM);
-- 
1.8.3.1




More information about the libvir-list mailing list