a41c76
From b9acfbcad6181babba50384741e0c30d6d0cc534 Mon Sep 17 00:00:00 2001
a41c76
Message-Id: <b9acfbcad6181babba50384741e0c30d6d0cc534@dist-git>
a41c76
From: Andrea Bolognani <abologna@redhat.com>
a41c76
Date: Fri, 14 Feb 2020 13:12:37 +0100
a41c76
Subject: [PATCH] qemu: Format the armvtimer timer on the command line
a41c76
MIME-Version: 1.0
a41c76
Content-Type: text/plain; charset=UTF-8
a41c76
Content-Transfer-Encoding: 8bit
a41c76
a41c76
Its behavior is controlled by a KVM-specific CPU feature.
a41c76
a41c76
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
a41c76
Reviewed-by: Masayoshi Mizuma <m.mizuma@jp.fujitsu.com>
a41c76
Reviewed-by: Ján Tomko <jtomko@redhat.com>
a41c76
(cherry picked from commit 7c4bc108a9bd7bda1543131d232e2ccee92a9e43)
a41c76
a41c76
https://bugzilla.redhat.com/show_bug.cgi?id=1762634
a41c76
a41c76
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
a41c76
Message-Id: <20200214121237.623948-7-abologna@redhat.com>
a41c76
Reviewed-by: Ján Tomko <jtomko@redhat.com>
a41c76
---
a41c76
 src/qemu/qemu_command.c | 13 +++++++++++++
a41c76
 1 file changed, 13 insertions(+)
a41c76
a41c76
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
a41c76
index e1e19e0fcc..1a5142d472 100644
a41c76
--- a/src/qemu/qemu_command.c
a41c76
+++ b/src/qemu/qemu_command.c
a41c76
@@ -6633,6 +6633,19 @@ qemuBuildCpuCommandLine(virCommandPtr cmd,
a41c76
                 virBufferAsprintf(&buf, ",tsc-frequency=%lu", timer->frequency);
a41c76
             break;
a41c76
         case VIR_DOMAIN_TIMER_NAME_ARMVTIMER:
a41c76
+            switch (timer->tickpolicy) {
a41c76
+            case VIR_DOMAIN_TIMER_TICKPOLICY_DELAY:
a41c76
+                virBufferAddLit(&buf, ",kvm-no-adjvtime=off");
a41c76
+                break;
a41c76
+            case VIR_DOMAIN_TIMER_TICKPOLICY_DISCARD:
a41c76
+                virBufferAddLit(&buf, ",kvm-no-adjvtime=on");
a41c76
+                break;
a41c76
+            case -1:
a41c76
+            case VIR_DOMAIN_TIMER_TICKPOLICY_CATCHUP:
a41c76
+            case VIR_DOMAIN_TIMER_TICKPOLICY_MERGE:
a41c76
+                break;
a41c76
+            }
a41c76
+            break;
a41c76
         case VIR_DOMAIN_TIMER_NAME_PLATFORM:
a41c76
         case VIR_DOMAIN_TIMER_NAME_PIT:
a41c76
         case VIR_DOMAIN_TIMER_NAME_RTC:
a41c76
-- 
a41c76
2.25.0
a41c76