render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
abb18f
From 9f9fcbc842846c6f2579ca52190f506060e191d8 Mon Sep 17 00:00:00 2001
abb18f
Message-Id: <9f9fcbc842846c6f2579ca52190f506060e191d8@dist-git>
abb18f
From: Michal Privoznik <mprivozn@redhat.com>
abb18f
Date: Mon, 21 Mar 2022 16:55:05 +0100
abb18f
Subject: [PATCH] qemu_capabilities: Detect memory-backend-*.prealloc-threads
abb18f
 property
abb18f
abb18f
The prealloc-threads is property of memory-backend class which is
abb18f
parent to the other three classes memory-backend-{ram,file,memfd}.
abb18f
Therefore the property is present for all, or none if QEMU is
abb18f
older than v5.0.0-rc0~75^2~1^2~3 which introduced the property.
abb18f
abb18f
Anyway, the .reserve property is the same story, and we chose
abb18f
memory-backend-file to detect it, so stick with our earlier
abb18f
decision and use the same backend to detect this new property.
abb18f
abb18f
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
abb18f
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
abb18f
(cherry picked from commit a30dac15dcdb7a6c7a3e9b6cfc5cd77bae185081)
abb18f
abb18f
Conflicts:
abb18f
src/qemu/qemu_capabilities.c: Context
abb18f
src/qemu/qemu_capabilities.h
abb18f
tests/qemucapabilitiesdata/caps_5.2.0.aarch64.xml
abb18f
tests/qemucapabilitiesdata/caps_5.2.0.ppc64.xml
abb18f
tests/qemucapabilitiesdata/caps_5.2.0.riscv64.xml
abb18f
tests/qemucapabilitiesdata/caps_5.2.0.s390x.xml
abb18f
tests/qemucapabilitiesdata/caps_5.2.0.x86_64.xml
abb18f
tests/qemucapabilitiesdata/caps_6.0.0.aarch64.xml
abb18f
tests/qemucapabilitiesdata/caps_6.0.0.s390x.xml
abb18f
tests/qemucapabilitiesdata/caps_6.0.0.x86_64.xml
abb18f
tests/qemucapabilitiesdata/caps_6.1.0.x86_64.xml
abb18f
tests/qemucapabilitiesdata/caps_6.2.0.aarch64.xml
abb18f
tests/qemucapabilitiesdata/caps_6.2.0.ppc64.xml
abb18f
tests/qemucapabilitiesdata/caps_6.2.0.x86_64.xml
abb18f
tests/qemucapabilitiesdata/caps_7.0.0.ppc64.xml
abb18f
tests/qemucapabilitiesdata/caps_7.0.0.x86_64.xml
abb18f
abb18f
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2075569
abb18f
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
abb18f
---
abb18f
 src/qemu/qemu_capabilities.c                      | 2 ++
abb18f
 src/qemu/qemu_capabilities.h                      | 1 +
abb18f
 tests/qemucapabilitiesdata/caps_5.0.0.aarch64.xml | 1 +
abb18f
 tests/qemucapabilitiesdata/caps_5.0.0.ppc64.xml   | 1 +
abb18f
 tests/qemucapabilitiesdata/caps_5.0.0.riscv64.xml | 1 +
abb18f
 tests/qemucapabilitiesdata/caps_5.0.0.x86_64.xml  | 1 +
abb18f
 tests/qemucapabilitiesdata/caps_5.1.0.sparc.xml   | 1 +
abb18f
 tests/qemucapabilitiesdata/caps_5.1.0.x86_64.xml  | 1 +
abb18f
 tests/qemucapabilitiesdata/caps_5.2.0.aarch64.xml | 1 +
abb18f
 tests/qemucapabilitiesdata/caps_5.2.0.ppc64.xml   | 1 +
abb18f
 tests/qemucapabilitiesdata/caps_5.2.0.riscv64.xml | 1 +
abb18f
 tests/qemucapabilitiesdata/caps_5.2.0.s390x.xml   | 1 +
abb18f
 tests/qemucapabilitiesdata/caps_5.2.0.x86_64.xml  | 1 +
abb18f
 tests/qemucapabilitiesdata/caps_6.0.0.aarch64.xml | 1 +
abb18f
 tests/qemucapabilitiesdata/caps_6.0.0.s390x.xml   | 1 +
abb18f
 tests/qemucapabilitiesdata/caps_6.0.0.x86_64.xml  | 1 +
abb18f
 tests/qemucapabilitiesdata/caps_6.1.0.x86_64.xml  | 1 +
abb18f
 tests/qemucapabilitiesdata/caps_6.2.0.aarch64.xml | 1 +
abb18f
 tests/qemucapabilitiesdata/caps_6.2.0.ppc64.xml   | 1 +
abb18f
 tests/qemucapabilitiesdata/caps_6.2.0.x86_64.xml  | 1 +
abb18f
 20 files changed, 21 insertions(+)
abb18f
abb18f
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
abb18f
index 8ae80ef8d7..c4f7db55c8 100644
abb18f
--- a/src/qemu/qemu_capabilities.c
abb18f
+++ b/src/qemu/qemu_capabilities.c
abb18f
@@ -657,6 +657,7 @@ VIR_ENUM_IMPL(virQEMUCaps,
abb18f
 
abb18f
               /* 420 */
abb18f
               "blockdev-reopen.__com.redhat_rhel-av-8_2_0-api", /* QEMU_CAPS_BLOCKDEV_REOPEN_COM_REDHAT_AV_8_2_0_API */
abb18f
+              "memory-backend-file.prealloc-threads", /* QEMU_CAPS_MEMORY_BACKEND_PREALLOC_THREADS */
abb18f
     );
abb18f
 
abb18f
 
abb18f
@@ -1713,6 +1714,7 @@ static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsMemoryBackendFile[] =
abb18f
      * released qemu versions. */
abb18f
     { "x-use-canonical-path-for-ramblock-id", QEMU_CAPS_X_USE_CANONICAL_PATH_FOR_RAMBLOCK_ID },
abb18f
     { "reserve", QEMU_CAPS_MEMORY_BACKEND_RESERVE },
abb18f
+    { "prealloc-threads", QEMU_CAPS_MEMORY_BACKEND_PREALLOC_THREADS },
abb18f
 };
abb18f
 
abb18f
 static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsMemoryBackendMemfd[] = {
abb18f
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
abb18f
index cde6c18b4c..8e65635e0d 100644
abb18f
--- a/src/qemu/qemu_capabilities.h
abb18f
+++ b/src/qemu/qemu_capabilities.h
abb18f
@@ -636,6 +636,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for syntax-check */
abb18f
 
abb18f
     /* 420 */
abb18f
     QEMU_CAPS_BLOCKDEV_REOPEN_COM_REDHAT_AV_8_2_0_API, /* downstream support for blockdev reopen in rhel-av-8.2.0 */
abb18f
+    QEMU_CAPS_MEMORY_BACKEND_PREALLOC_THREADS, /* -object memory-backend-*.prealloc-threads */
abb18f
 
abb18f
     QEMU_CAPS_LAST /* this must always be the last item */
abb18f
 } virQEMUCapsFlags;
abb18f
diff --git a/tests/qemucapabilitiesdata/caps_5.0.0.aarch64.xml b/tests/qemucapabilitiesdata/caps_5.0.0.aarch64.xml
abb18f
index bb6a7d5ee7..3b18f160db 100644
abb18f
--- a/tests/qemucapabilitiesdata/caps_5.0.0.aarch64.xml
abb18f
+++ b/tests/qemucapabilitiesdata/caps_5.0.0.aarch64.xml
abb18f
@@ -179,6 +179,7 @@
abb18f
   <flag name='input-linux'/>
abb18f
   <flag name='query-display-options'/>
abb18f
   <flag name='virtio-blk.queue-size'/>
abb18f
+  <flag name='memory-backend-file.prealloc-threads'/>
abb18f
   <version>5000000</version>
abb18f
   <kvmVersion>0</kvmVersion>
abb18f
   <microcodeVersion>61700241</microcodeVersion>
abb18f
diff --git a/tests/qemucapabilitiesdata/caps_5.0.0.ppc64.xml b/tests/qemucapabilitiesdata/caps_5.0.0.ppc64.xml
abb18f
index f8317c1117..c90f2be296 100644
abb18f
--- a/tests/qemucapabilitiesdata/caps_5.0.0.ppc64.xml
abb18f
+++ b/tests/qemucapabilitiesdata/caps_5.0.0.ppc64.xml
abb18f
@@ -187,6 +187,7 @@
abb18f
   <flag name='input-linux'/>
abb18f
   <flag name='query-display-options'/>
abb18f
   <flag name='virtio-blk.queue-size'/>
abb18f
+  <flag name='memory-backend-file.prealloc-threads'/>
abb18f
   <version>5000000</version>
abb18f
   <kvmVersion>0</kvmVersion>
abb18f
   <microcodeVersion>42900241</microcodeVersion>
abb18f
diff --git a/tests/qemucapabilitiesdata/caps_5.0.0.riscv64.xml b/tests/qemucapabilitiesdata/caps_5.0.0.riscv64.xml
abb18f
index 58c7eb6651..8fbe8f114f 100644
abb18f
--- a/tests/qemucapabilitiesdata/caps_5.0.0.riscv64.xml
abb18f
+++ b/tests/qemucapabilitiesdata/caps_5.0.0.riscv64.xml
abb18f
@@ -171,6 +171,7 @@
abb18f
   <flag name='input-linux'/>
abb18f
   <flag name='query-display-options'/>
abb18f
   <flag name='virtio-blk.queue-size'/>
abb18f
+  <flag name='memory-backend-file.prealloc-threads'/>
abb18f
   <version>5000000</version>
abb18f
   <kvmVersion>0</kvmVersion>
abb18f
   <microcodeVersion>0</microcodeVersion>
abb18f
diff --git a/tests/qemucapabilitiesdata/caps_5.0.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_5.0.0.x86_64.xml
abb18f
index 69f49020e7..b76c4346a4 100644
abb18f
--- a/tests/qemucapabilitiesdata/caps_5.0.0.x86_64.xml
abb18f
+++ b/tests/qemucapabilitiesdata/caps_5.0.0.x86_64.xml
abb18f
@@ -221,6 +221,7 @@
abb18f
   <flag name='input-linux'/>
abb18f
   <flag name='query-display-options'/>
abb18f
   <flag name='virtio-blk.queue-size'/>
abb18f
+  <flag name='memory-backend-file.prealloc-threads'/>
abb18f
   <version>5000000</version>
abb18f
   <kvmVersion>0</kvmVersion>
abb18f
   <microcodeVersion>43100241</microcodeVersion>
abb18f
diff --git a/tests/qemucapabilitiesdata/caps_5.1.0.sparc.xml b/tests/qemucapabilitiesdata/caps_5.1.0.sparc.xml
abb18f
index 58af90b29f..7de7c291f5 100644
abb18f
--- a/tests/qemucapabilitiesdata/caps_5.1.0.sparc.xml
abb18f
+++ b/tests/qemucapabilitiesdata/caps_5.1.0.sparc.xml
abb18f
@@ -90,6 +90,7 @@
abb18f
   <flag name='rotation-rate'/>
abb18f
   <flag name='input-linux'/>
abb18f
   <flag name='query-display-options'/>
abb18f
+  <flag name='memory-backend-file.prealloc-threads'/>
abb18f
   <version>5001000</version>
abb18f
   <kvmVersion>0</kvmVersion>
abb18f
   <microcodeVersion>0</microcodeVersion>
abb18f
diff --git a/tests/qemucapabilitiesdata/caps_5.1.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_5.1.0.x86_64.xml
abb18f
index 578e16e8b0..9b5cb3cd7a 100644
abb18f
--- a/tests/qemucapabilitiesdata/caps_5.1.0.x86_64.xml
abb18f
+++ b/tests/qemucapabilitiesdata/caps_5.1.0.x86_64.xml
abb18f
@@ -224,6 +224,7 @@
abb18f
   <flag name='query-display-options'/>
abb18f
   <flag name='virtio-blk.queue-size'/>
abb18f
   <flag name='virtio-mem-pci'/>
abb18f
+  <flag name='memory-backend-file.prealloc-threads'/>
abb18f
   <version>5001000</version>
abb18f
   <kvmVersion>0</kvmVersion>
abb18f
   <microcodeVersion>43100242</microcodeVersion>
abb18f
diff --git a/tests/qemucapabilitiesdata/caps_5.2.0.aarch64.xml b/tests/qemucapabilitiesdata/caps_5.2.0.aarch64.xml
abb18f
index b943eaedaf..020c04c1c4 100644
abb18f
--- a/tests/qemucapabilitiesdata/caps_5.2.0.aarch64.xml
abb18f
+++ b/tests/qemucapabilitiesdata/caps_5.2.0.aarch64.xml
abb18f
@@ -184,6 +184,7 @@
abb18f
   <flag name='query-display-options'/>
abb18f
   <flag name='virtio-blk.queue-size'/>
abb18f
   <flag name='query-dirty-rate'/>
abb18f
+  <flag name='memory-backend-file.prealloc-threads'/>
abb18f
   <version>5002000</version>
abb18f
   <kvmVersion>0</kvmVersion>
abb18f
   <microcodeVersion>61700243</microcodeVersion>
abb18f
diff --git a/tests/qemucapabilitiesdata/caps_5.2.0.ppc64.xml b/tests/qemucapabilitiesdata/caps_5.2.0.ppc64.xml
abb18f
index ec64e1cacf..5346b1552c 100644
abb18f
--- a/tests/qemucapabilitiesdata/caps_5.2.0.ppc64.xml
abb18f
+++ b/tests/qemucapabilitiesdata/caps_5.2.0.ppc64.xml
abb18f
@@ -190,6 +190,7 @@
abb18f
   <flag name='query-display-options'/>
abb18f
   <flag name='virtio-blk.queue-size'/>
abb18f
   <flag name='query-dirty-rate'/>
abb18f
+  <flag name='memory-backend-file.prealloc-threads'/>
abb18f
   <version>5002000</version>
abb18f
   <kvmVersion>0</kvmVersion>
abb18f
   <microcodeVersion>42900243</microcodeVersion>
abb18f
diff --git a/tests/qemucapabilitiesdata/caps_5.2.0.riscv64.xml b/tests/qemucapabilitiesdata/caps_5.2.0.riscv64.xml
abb18f
index a11d15f91a..9f6974f85d 100644
abb18f
--- a/tests/qemucapabilitiesdata/caps_5.2.0.riscv64.xml
abb18f
+++ b/tests/qemucapabilitiesdata/caps_5.2.0.riscv64.xml
abb18f
@@ -174,6 +174,7 @@
abb18f
   <flag name='query-display-options'/>
abb18f
   <flag name='virtio-blk.queue-size'/>
abb18f
   <flag name='query-dirty-rate'/>
abb18f
+  <flag name='memory-backend-file.prealloc-threads'/>
abb18f
   <version>5002000</version>
abb18f
   <kvmVersion>0</kvmVersion>
abb18f
   <microcodeVersion>0</microcodeVersion>
abb18f
diff --git a/tests/qemucapabilitiesdata/caps_5.2.0.s390x.xml b/tests/qemucapabilitiesdata/caps_5.2.0.s390x.xml
abb18f
index 552e1d43c9..44753b64c3 100644
abb18f
--- a/tests/qemucapabilitiesdata/caps_5.2.0.s390x.xml
abb18f
+++ b/tests/qemucapabilitiesdata/caps_5.2.0.s390x.xml
abb18f
@@ -141,6 +141,7 @@
abb18f
   <flag name='query-display-options'/>
abb18f
   <flag name='virtio-blk.queue-size'/>
abb18f
   <flag name='query-dirty-rate'/>
abb18f
+  <flag name='memory-backend-file.prealloc-threads'/>
abb18f
   <version>5002000</version>
abb18f
   <kvmVersion>0</kvmVersion>
abb18f
   <microcodeVersion>39100243</microcodeVersion>
abb18f
diff --git a/tests/qemucapabilitiesdata/caps_5.2.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_5.2.0.x86_64.xml
abb18f
index bcc262551a..db11c99739 100644
abb18f
--- a/tests/qemucapabilitiesdata/caps_5.2.0.x86_64.xml
abb18f
+++ b/tests/qemucapabilitiesdata/caps_5.2.0.x86_64.xml
abb18f
@@ -227,6 +227,7 @@
abb18f
   <flag name='virtio-mem-pci'/>
abb18f
   <flag name='piix4.acpi-root-pci-hotplug'/>
abb18f
   <flag name='query-dirty-rate'/>
abb18f
+  <flag name='memory-backend-file.prealloc-threads'/>
abb18f
   <version>5002000</version>
abb18f
   <kvmVersion>0</kvmVersion>
abb18f
   <microcodeVersion>43100243</microcodeVersion>
abb18f
diff --git a/tests/qemucapabilitiesdata/caps_6.0.0.aarch64.xml b/tests/qemucapabilitiesdata/caps_6.0.0.aarch64.xml
abb18f
index 0fefe64537..5f9a97df43 100644
abb18f
--- a/tests/qemucapabilitiesdata/caps_6.0.0.aarch64.xml
abb18f
+++ b/tests/qemucapabilitiesdata/caps_6.0.0.aarch64.xml
abb18f
@@ -192,6 +192,7 @@
abb18f
   <flag name='set-action'/>
abb18f
   <flag name='virtio-blk.queue-size'/>
abb18f
   <flag name='query-dirty-rate'/>
abb18f
+  <flag name='memory-backend-file.prealloc-threads'/>
abb18f
   <version>6000000</version>
abb18f
   <kvmVersion>0</kvmVersion>
abb18f
   <microcodeVersion>61700242</microcodeVersion>
abb18f
diff --git a/tests/qemucapabilitiesdata/caps_6.0.0.s390x.xml b/tests/qemucapabilitiesdata/caps_6.0.0.s390x.xml
abb18f
index 61685066b8..46bd1d3d2d 100644
abb18f
--- a/tests/qemucapabilitiesdata/caps_6.0.0.s390x.xml
abb18f
+++ b/tests/qemucapabilitiesdata/caps_6.0.0.s390x.xml
abb18f
@@ -149,6 +149,7 @@
abb18f
   <flag name='set-action'/>
abb18f
   <flag name='virtio-blk.queue-size'/>
abb18f
   <flag name='query-dirty-rate'/>
abb18f
+  <flag name='memory-backend-file.prealloc-threads'/>
abb18f
   <version>6000000</version>
abb18f
   <kvmVersion>0</kvmVersion>
abb18f
   <microcodeVersion>39100242</microcodeVersion>
abb18f
diff --git a/tests/qemucapabilitiesdata/caps_6.0.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_6.0.0.x86_64.xml
abb18f
index 0d6763e9a3..99bbb6e237 100644
abb18f
--- a/tests/qemucapabilitiesdata/caps_6.0.0.x86_64.xml
abb18f
+++ b/tests/qemucapabilitiesdata/caps_6.0.0.x86_64.xml
abb18f
@@ -236,6 +236,7 @@
abb18f
   <flag name='piix4.acpi-root-pci-hotplug'/>
abb18f
   <flag name='query-dirty-rate'/>
abb18f
   <flag name='sev-inject-launch-secret'/>
abb18f
+  <flag name='memory-backend-file.prealloc-threads'/>
abb18f
   <version>6000000</version>
abb18f
   <kvmVersion>0</kvmVersion>
abb18f
   <microcodeVersion>43100242</microcodeVersion>
abb18f
diff --git a/tests/qemucapabilitiesdata/caps_6.1.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_6.1.0.x86_64.xml
abb18f
index 228f397c67..ff0715e605 100644
abb18f
--- a/tests/qemucapabilitiesdata/caps_6.1.0.x86_64.xml
abb18f
+++ b/tests/qemucapabilitiesdata/caps_6.1.0.x86_64.xml
abb18f
@@ -240,6 +240,7 @@
abb18f
   <flag name='query-dirty-rate'/>
abb18f
   <flag name='rbd-encryption'/>
abb18f
   <flag name='sev-inject-launch-secret'/>
abb18f
+  <flag name='memory-backend-file.prealloc-threads'/>
abb18f
   <version>6001000</version>
abb18f
   <kvmVersion>0</kvmVersion>
abb18f
   <microcodeVersion>43100243</microcodeVersion>
abb18f
diff --git a/tests/qemucapabilitiesdata/caps_6.2.0.aarch64.xml b/tests/qemucapabilitiesdata/caps_6.2.0.aarch64.xml
abb18f
index 6bf9933bc5..dd6f0e6919 100644
abb18f
--- a/tests/qemucapabilitiesdata/caps_6.2.0.aarch64.xml
abb18f
+++ b/tests/qemucapabilitiesdata/caps_6.2.0.aarch64.xml
abb18f
@@ -203,6 +203,7 @@
abb18f
   <flag name='memory-backend-file.reserve'/>
abb18f
   <flag name='query-dirty-rate'/>
abb18f
   <flag name='rbd-encryption'/>
abb18f
+  <flag name='memory-backend-file.prealloc-threads'/>
abb18f
   <version>6001050</version>
abb18f
   <kvmVersion>0</kvmVersion>
abb18f
   <microcodeVersion>61700244</microcodeVersion>
abb18f
diff --git a/tests/qemucapabilitiesdata/caps_6.2.0.ppc64.xml b/tests/qemucapabilitiesdata/caps_6.2.0.ppc64.xml
abb18f
index 06cd7fb396..2646cdf88f 100644
abb18f
--- a/tests/qemucapabilitiesdata/caps_6.2.0.ppc64.xml
abb18f
+++ b/tests/qemucapabilitiesdata/caps_6.2.0.ppc64.xml
abb18f
@@ -199,6 +199,7 @@
abb18f
   <flag name='piix4.acpi-root-pci-hotplug'/>
abb18f
   <flag name='query-dirty-rate'/>
abb18f
   <flag name='rbd-encryption'/>
abb18f
+  <flag name='memory-backend-file.prealloc-threads'/>
abb18f
   <version>6001050</version>
abb18f
   <kvmVersion>0</kvmVersion>
abb18f
   <microcodeVersion>42900244</microcodeVersion>
abb18f
diff --git a/tests/qemucapabilitiesdata/caps_6.2.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_6.2.0.x86_64.xml
abb18f
index 75aaeed03c..f25ec1b84a 100644
abb18f
--- a/tests/qemucapabilitiesdata/caps_6.2.0.x86_64.xml
abb18f
+++ b/tests/qemucapabilitiesdata/caps_6.2.0.x86_64.xml
abb18f
@@ -241,6 +241,7 @@
abb18f
   <flag name='rbd-encryption'/>
abb18f
   <flag name='sev-guest-kernel-hashes'/>
abb18f
   <flag name='sev-inject-launch-secret'/>
abb18f
+  <flag name='memory-backend-file.prealloc-threads'/>
abb18f
   <version>6002000</version>
abb18f
   <kvmVersion>0</kvmVersion>
abb18f
   <microcodeVersion>43100244</microcodeVersion>
abb18f
-- 
abb18f
2.35.1
abb18f