render / rpms / libvirt

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