render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
Blob Blame History Raw
From eb6bdf4798eea9bae5ddca1fdd13fb5ef6e99596 Mon Sep 17 00:00:00 2001
Message-Id: <eb6bdf4798eea9bae5ddca1fdd13fb5ef6e99596@dist-git>
From: Andrea Bolognani <abologna@redhat.com>
Date: Fri, 14 Feb 2020 13:12:35 +0100
Subject: [PATCH] conf: Introduce VIR_DOMAIN_TIMER_NAME_ARMVTIMER
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

This new timer model will be used to control the behavior of the
virtual timer for KVM ARM/virt guests.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Masayoshi Mizuma <m.mizuma@jp.fujitsu.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
(cherry picked from commit 3809e88a87e5898c9cf3a277cb32e20fca8fb2d0)

https://bugzilla.redhat.com/show_bug.cgi?id=1762634

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Message-Id: <20200214121237.623948-5-abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
---
 docs/schemas/domaincommon.rng | 1 +
 src/conf/domain_conf.c        | 1 +
 src/conf/domain_conf.h        | 1 +
 src/libxl/libxl_conf.c        | 1 +
 src/libxl/xen_common.c        | 1 +
 src/qemu/qemu_command.c       | 2 ++
 src/qemu/qemu_domain.c        | 3 +++
 7 files changed, 10 insertions(+)

diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
index 026e753567..19476a2735 100644
--- a/docs/schemas/domaincommon.rng
+++ b/docs/schemas/domaincommon.rng
@@ -1239,6 +1239,7 @@
             <choice>
               <value>hpet</value>
               <value>pit</value>
+              <value>armvtimer</value>
             </choice>
           </attribute>
           <optional>
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 58f72b3b0f..68d9ce9c4e 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -1062,6 +1062,7 @@ VIR_ENUM_IMPL(virDomainTimerName,
               "tsc",
               "kvmclock",
               "hypervclock",
+              "armvtimer",
 );
 
 VIR_ENUM_IMPL(virDomainTimerTrack,
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index ee8eb3ddc0..ef2c1b80f7 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -1989,6 +1989,7 @@ typedef enum {
     VIR_DOMAIN_TIMER_NAME_TSC,
     VIR_DOMAIN_TIMER_NAME_KVMCLOCK,
     VIR_DOMAIN_TIMER_NAME_HYPERVCLOCK,
+    VIR_DOMAIN_TIMER_NAME_ARMVTIMER,
 
     VIR_DOMAIN_TIMER_NAME_LAST
 } virDomainTimerNameType;
diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c
index 2488bb9d32..ffac890262 100644
--- a/src/libxl/libxl_conf.c
+++ b/src/libxl/libxl_conf.c
@@ -361,6 +361,7 @@ libxlMakeDomBuildInfo(virDomainDefPtr def,
         case VIR_DOMAIN_TIMER_NAME_HYPERVCLOCK:
         case VIR_DOMAIN_TIMER_NAME_RTC:
         case VIR_DOMAIN_TIMER_NAME_PIT:
+        case VIR_DOMAIN_TIMER_NAME_ARMVTIMER:
             virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
                            _("unsupported timer type (name) '%s'"),
                            virDomainTimerNameTypeToString(clock.timers[i]->name));
diff --git a/src/libxl/xen_common.c b/src/libxl/xen_common.c
index 415549a42c..9a385eba0d 100644
--- a/src/libxl/xen_common.c
+++ b/src/libxl/xen_common.c
@@ -2182,6 +2182,7 @@ xenFormatCPUFeatures(virConfPtr conf, virDomainDefPtr def)
         case VIR_DOMAIN_TIMER_NAME_HYPERVCLOCK:
         case VIR_DOMAIN_TIMER_NAME_RTC:
         case VIR_DOMAIN_TIMER_NAME_PIT:
+        case VIR_DOMAIN_TIMER_NAME_ARMVTIMER:
             virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
                            _("unsupported timer type (name) '%s'"),
                            virDomainTimerNameTypeToString(def->clock.timers[i]->name));
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 0ad09baa1d..e1e19e0fcc 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -6200,6 +6200,7 @@ qemuBuildClockCommandLine(virCommandPtr cmd,
         case VIR_DOMAIN_TIMER_NAME_TSC:
         case VIR_DOMAIN_TIMER_NAME_KVMCLOCK:
         case VIR_DOMAIN_TIMER_NAME_HYPERVCLOCK:
+        case VIR_DOMAIN_TIMER_NAME_ARMVTIMER:
             /* Timers above are handled when building -cpu.  */
         case VIR_DOMAIN_TIMER_NAME_LAST:
             break;
@@ -6631,6 +6632,7 @@ qemuBuildCpuCommandLine(virCommandPtr cmd,
             if (timer->frequency > 0)
                 virBufferAsprintf(&buf, ",tsc-frequency=%lu", timer->frequency);
             break;
+        case VIR_DOMAIN_TIMER_NAME_ARMVTIMER:
         case VIR_DOMAIN_TIMER_NAME_PLATFORM:
         case VIR_DOMAIN_TIMER_NAME_PIT:
         case VIR_DOMAIN_TIMER_NAME_RTC:
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 846d1ecb29..4de4f9da53 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -5504,6 +5504,9 @@ qemuDomainDefValidateClockTimers(const virDomainDef *def,
                 return -1;
             }
             break;
+
+        case VIR_DOMAIN_TIMER_NAME_ARMVTIMER:
+            break;
         }
     }
 
-- 
2.25.0