[libvirt] [PATCH 1/3] qemu: fix pit timer tick policy=delay

Maxim Nestratov mnestratov at virtuozzo.com
Fri Dec 9 14:28:04 UTC 2016


By a mistake, 'delay' libvirt xml parameter was converted to 'discard' QEMU
command line string one.

Test "kvm-pit-delay" is fixed accordinly, so that redundant test cases removed
as there is no need to specify both QEMU_CAPS_NO_KVM_PIT and
QEMU_CAPS_KVM_PIT_TICK_POLICY simultaneusly in tests as they are mutually
exclusive and "kvm-pit-device" becomes just the same as "kvm-pit-delay".

Signed-off-by: Maxim Nestratov <mnestratov at virtuozzo.com>
---
 src/qemu/qemu_command.c                                | 2 +-
 tests/qemuxml2argvdata/qemuxml2argv-kvm-pit-delay.args | 2 +-
 tests/qemuxml2argvtest.c                               | 5 +----
 3 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 815abff..cd243e4 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -6139,7 +6139,7 @@ qemuBuildClockCommandLine(virCommandPtr cmd,
                    (-no-kvm-pit), otherwise, the default is catchup. */
                 if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_KVM_PIT_TICK_POLICY))
                     virCommandAddArgList(cmd, "-global",
-                                         "kvm-pit.lost_tick_policy=discard", NULL);
+                                         "kvm-pit.lost_tick_policy=delay", NULL);
                 else if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_NO_KVM_PIT))
                     virCommandAddArg(cmd, "-no-kvm-pit-reinjection");
                 break;
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-kvm-pit-delay.args b/tests/qemuxml2argvdata/qemuxml2argv-kvm-pit-delay.args
index 1d69797..7a02d36 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-kvm-pit-delay.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-kvm-pit-delay.args
@@ -14,7 +14,7 @@ QEMU_AUDIO_DRV=none \
 -nographic \
 -nodefaults \
 -monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \
--no-kvm-pit-reinjection \
+-global kvm-pit.lost_tick_policy=delay \
 -no-acpi \
 -boot c \
 -usb \
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 90d6aaf..b8619dd 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -2059,10 +2059,7 @@ mymain(void)
             QEMU_CAPS_KVM);
     qemuTestSetHostArch(driver.caps, VIR_ARCH_NONE);
 
-    DO_TEST("kvm-pit-device", QEMU_CAPS_KVM_PIT_TICK_POLICY);
-    DO_TEST("kvm-pit-delay", QEMU_CAPS_NO_KVM_PIT);
-    DO_TEST("kvm-pit-device", QEMU_CAPS_NO_KVM_PIT,
-            QEMU_CAPS_KVM_PIT_TICK_POLICY);
+    DO_TEST("kvm-pit-delay", QEMU_CAPS_KVM_PIT_TICK_POLICY);
 
     DO_TEST("panic", QEMU_CAPS_DEVICE_PANIC,
             QEMU_CAPS_NODEFCONFIG);
-- 
2.4.11




More information about the libvir-list mailing list