fbe740
From 694540f2c93ccee78e203c5fe92be5e1a05a2281 Mon Sep 17 00:00:00 2001
fbe740
Message-Id: <694540f2c93ccee78e203c5fe92be5e1a05a2281@dist-git>
fbe740
From: Andrea Bolognani <abologna@redhat.com>
fbe740
Date: Fri, 14 Feb 2020 13:12:34 +0100
fbe740
Subject: [PATCH] qemu: Add the QEMU_CAPS_CPU_KVM_NO_ADJVTIME capability
fbe740
MIME-Version: 1.0
fbe740
Content-Type: text/plain; charset=UTF-8
fbe740
Content-Transfer-Encoding: 8bit
fbe740
fbe740
We will use this capability to detect whether the QEMU binary
fbe740
supports the kvm-no-adjvtime CPU feature.
fbe740
fbe740
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
fbe740
Reviewed-by: Masayoshi Mizuma <m.mizuma@jp.fujitsu.com>
fbe740
Reviewed-by: Ján Tomko <jtomko@redhat.com>
fbe740
(cherry picked from commit 204e2306e582524b46c4e26e1f0aa354aa50d006)
fbe740
fbe740
Conflicts:
fbe740
fbe740
  * src/qemu/qemu_capabilities.c
fbe740
    src/qemu/qemu_capabilities.h
fbe740
fbe740
    + tpm-spapr has not been backported
fbe740
fbe740
https://bugzilla.redhat.com/show_bug.cgi?id=1762634
fbe740
fbe740
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
fbe740
Message-Id: <20200214121237.623948-4-abologna@redhat.com>
fbe740
Reviewed-by: Ján Tomko <jtomko@redhat.com>
fbe740
---
fbe740
 src/qemu/qemu_capabilities.c                      | 2 ++
fbe740
 src/qemu/qemu_capabilities.h                      | 1 +
fbe740
 tests/qemucapabilitiesdata/caps_5.0.0.aarch64.xml | 1 +
fbe740
 3 files changed, 4 insertions(+)
fbe740
fbe740
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
fbe740
index 10c17323be..6912a6f72b 100644
fbe740
--- a/src/qemu/qemu_capabilities.c
fbe740
+++ b/src/qemu/qemu_capabilities.c
fbe740
@@ -557,6 +557,7 @@ VIR_ENUM_IMPL(virQEMUCaps,
fbe740
 
fbe740
               /* 350 */
fbe740
               "virtio-net.failover",
fbe740
+              "cpu.kvm-no-adjvtime",
fbe740
     );
fbe740
 
fbe740
 
fbe740
@@ -1557,6 +1558,7 @@ static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsMemoryBackendMemfd[]
fbe740
 
fbe740
 static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsMaxCPU[] = {
fbe740
     { "unavailable-features", QEMU_CAPS_CPU_UNAVAILABLE_FEATURES },
fbe740
+    { "kvm-no-adjvtime", QEMU_CAPS_CPU_KVM_NO_ADJVTIME },
fbe740
 };
fbe740
 
fbe740
 static virQEMUCapsObjectTypeProps virQEMUCapsObjectProps[] = {
fbe740
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
fbe740
index 6ab0eabd3f..4ccb0c55bc 100644
fbe740
--- a/src/qemu/qemu_capabilities.h
fbe740
+++ b/src/qemu/qemu_capabilities.h
fbe740
@@ -538,6 +538,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for syntax-check */
fbe740
 
fbe740
     /* 350 */
fbe740
     QEMU_CAPS_VIRTIO_NET_FAILOVER, /* virtio-net-*.failover */
fbe740
+    QEMU_CAPS_CPU_KVM_NO_ADJVTIME, /* cpu.kvm-no-adjvtime */
fbe740
 
fbe740
     QEMU_CAPS_LAST /* this must always be the last item */
fbe740
 } virQEMUCapsFlags;
fbe740
diff --git a/tests/qemucapabilitiesdata/caps_5.0.0.aarch64.xml b/tests/qemucapabilitiesdata/caps_5.0.0.aarch64.xml
fbe740
index 6b365dd75d..e871ba528e 100644
fbe740
--- a/tests/qemucapabilitiesdata/caps_5.0.0.aarch64.xml
fbe740
+++ b/tests/qemucapabilitiesdata/caps_5.0.0.aarch64.xml
fbe740
@@ -178,6 +178,7 @@
fbe740
   <flag name='drive-nvme'/>
fbe740
   <flag name='smp-dies'/>
fbe740
   <flag name='virtio-net.failover'/>
fbe740
+  <flag name='cpu.kvm-no-adjvtime'/>
fbe740
   <version>4002050</version>
fbe740
   <kvmVersion>0</kvmVersion>
fbe740
   <microcodeVersion>61700241</microcodeVersion>
fbe740
-- 
fbe740
2.25.0
fbe740