render / rpms / libvirt

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