render / rpms / libvirt

Forked from rpms/libvirt 10 months ago
Clone
a41c76
From eb6bdf4798eea9bae5ddca1fdd13fb5ef6e99596 Mon Sep 17 00:00:00 2001
a41c76
Message-Id: <eb6bdf4798eea9bae5ddca1fdd13fb5ef6e99596@dist-git>
a41c76
From: Andrea Bolognani <abologna@redhat.com>
a41c76
Date: Fri, 14 Feb 2020 13:12:35 +0100
a41c76
Subject: [PATCH] conf: Introduce VIR_DOMAIN_TIMER_NAME_ARMVTIMER
a41c76
MIME-Version: 1.0
a41c76
Content-Type: text/plain; charset=UTF-8
a41c76
Content-Transfer-Encoding: 8bit
a41c76
a41c76
This new timer model will be used to control the behavior of the
a41c76
virtual timer for KVM ARM/virt guests.
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 3809e88a87e5898c9cf3a277cb32e20fca8fb2d0)
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-5-abologna@redhat.com>
a41c76
Reviewed-by: Ján Tomko <jtomko@redhat.com>
a41c76
---
a41c76
 docs/schemas/domaincommon.rng | 1 +
a41c76
 src/conf/domain_conf.c        | 1 +
a41c76
 src/conf/domain_conf.h        | 1 +
a41c76
 src/libxl/libxl_conf.c        | 1 +
a41c76
 src/libxl/xen_common.c        | 1 +
a41c76
 src/qemu/qemu_command.c       | 2 ++
a41c76
 src/qemu/qemu_domain.c        | 3 +++
a41c76
 7 files changed, 10 insertions(+)
a41c76
a41c76
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
a41c76
index 026e753567..19476a2735 100644
a41c76
--- a/docs/schemas/domaincommon.rng
a41c76
+++ b/docs/schemas/domaincommon.rng
a41c76
@@ -1239,6 +1239,7 @@
a41c76
             <choice>
a41c76
               <value>hpet</value>
a41c76
               <value>pit</value>
a41c76
+              <value>armvtimer</value>
a41c76
             </choice>
a41c76
           </attribute>
a41c76
           <optional>
a41c76
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
a41c76
index 58f72b3b0f..68d9ce9c4e 100644
a41c76
--- a/src/conf/domain_conf.c
a41c76
+++ b/src/conf/domain_conf.c
a41c76
@@ -1062,6 +1062,7 @@ VIR_ENUM_IMPL(virDomainTimerName,
a41c76
               "tsc",
a41c76
               "kvmclock",
a41c76
               "hypervclock",
a41c76
+              "armvtimer",
a41c76
 );
a41c76
 
a41c76
 VIR_ENUM_IMPL(virDomainTimerTrack,
a41c76
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
a41c76
index ee8eb3ddc0..ef2c1b80f7 100644
a41c76
--- a/src/conf/domain_conf.h
a41c76
+++ b/src/conf/domain_conf.h
a41c76
@@ -1989,6 +1989,7 @@ typedef enum {
a41c76
     VIR_DOMAIN_TIMER_NAME_TSC,
a41c76
     VIR_DOMAIN_TIMER_NAME_KVMCLOCK,
a41c76
     VIR_DOMAIN_TIMER_NAME_HYPERVCLOCK,
a41c76
+    VIR_DOMAIN_TIMER_NAME_ARMVTIMER,
a41c76
 
a41c76
     VIR_DOMAIN_TIMER_NAME_LAST
a41c76
 } virDomainTimerNameType;
a41c76
diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c
a41c76
index 2488bb9d32..ffac890262 100644
a41c76
--- a/src/libxl/libxl_conf.c
a41c76
+++ b/src/libxl/libxl_conf.c
a41c76
@@ -361,6 +361,7 @@ libxlMakeDomBuildInfo(virDomainDefPtr def,
a41c76
         case VIR_DOMAIN_TIMER_NAME_HYPERVCLOCK:
a41c76
         case VIR_DOMAIN_TIMER_NAME_RTC:
a41c76
         case VIR_DOMAIN_TIMER_NAME_PIT:
a41c76
+        case VIR_DOMAIN_TIMER_NAME_ARMVTIMER:
a41c76
             virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
a41c76
                            _("unsupported timer type (name) '%s'"),
a41c76
                            virDomainTimerNameTypeToString(clock.timers[i]->name));
a41c76
diff --git a/src/libxl/xen_common.c b/src/libxl/xen_common.c
a41c76
index 415549a42c..9a385eba0d 100644
a41c76
--- a/src/libxl/xen_common.c
a41c76
+++ b/src/libxl/xen_common.c
a41c76
@@ -2182,6 +2182,7 @@ xenFormatCPUFeatures(virConfPtr conf, virDomainDefPtr def)
a41c76
         case VIR_DOMAIN_TIMER_NAME_HYPERVCLOCK:
a41c76
         case VIR_DOMAIN_TIMER_NAME_RTC:
a41c76
         case VIR_DOMAIN_TIMER_NAME_PIT:
a41c76
+        case VIR_DOMAIN_TIMER_NAME_ARMVTIMER:
a41c76
             virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
a41c76
                            _("unsupported timer type (name) '%s'"),
a41c76
                            virDomainTimerNameTypeToString(def->clock.timers[i]->name));
a41c76
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
a41c76
index 0ad09baa1d..e1e19e0fcc 100644
a41c76
--- a/src/qemu/qemu_command.c
a41c76
+++ b/src/qemu/qemu_command.c
a41c76
@@ -6200,6 +6200,7 @@ qemuBuildClockCommandLine(virCommandPtr cmd,
a41c76
         case VIR_DOMAIN_TIMER_NAME_TSC:
a41c76
         case VIR_DOMAIN_TIMER_NAME_KVMCLOCK:
a41c76
         case VIR_DOMAIN_TIMER_NAME_HYPERVCLOCK:
a41c76
+        case VIR_DOMAIN_TIMER_NAME_ARMVTIMER:
a41c76
             /* Timers above are handled when building -cpu.  */
a41c76
         case VIR_DOMAIN_TIMER_NAME_LAST:
a41c76
             break;
a41c76
@@ -6631,6 +6632,7 @@ qemuBuildCpuCommandLine(virCommandPtr cmd,
a41c76
             if (timer->frequency > 0)
a41c76
                 virBufferAsprintf(&buf, ",tsc-frequency=%lu", timer->frequency);
a41c76
             break;
a41c76
+        case VIR_DOMAIN_TIMER_NAME_ARMVTIMER:
a41c76
         case VIR_DOMAIN_TIMER_NAME_PLATFORM:
a41c76
         case VIR_DOMAIN_TIMER_NAME_PIT:
a41c76
         case VIR_DOMAIN_TIMER_NAME_RTC:
a41c76
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
a41c76
index 846d1ecb29..4de4f9da53 100644
a41c76
--- a/src/qemu/qemu_domain.c
a41c76
+++ b/src/qemu/qemu_domain.c
a41c76
@@ -5504,6 +5504,9 @@ qemuDomainDefValidateClockTimers(const virDomainDef *def,
a41c76
                 return -1;
a41c76
             }
a41c76
             break;
a41c76
+
a41c76
+        case VIR_DOMAIN_TIMER_NAME_ARMVTIMER:
a41c76
+            break;
a41c76
         }
a41c76
     }
a41c76
 
a41c76
-- 
a41c76
2.25.0
a41c76