qemu_capabilities: Detect memory-backend-*.prealloc-threads property

The prealloc-threads is property of memory-backend class which is
parent to the other three classes memory-backend-{ram,file,memfd}.
Therefore the property is present for all, or none if QEMU is
older than v5.0.0-rc0~75^2~1^2~3 which introduced the property.

Anyway, the .reserve property is the same story, and we chose
memory-backend-file to detect it, so stick with our earlier
decision and use the same backend to detect this new property.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
This commit is contained in:
Michal Privoznik 2022-03-21 16:55:05 +01:00
parent ba7f98126f
commit a30dac15dc
22 changed files with 23 additions and 0 deletions

View File

@ -668,6 +668,7 @@ VIR_ENUM_IMPL(virQEMUCaps,
/* 425 */
"blockdev.nbd.tls-hostname", /* QEMU_CAPS_BLOCKDEV_NBD_TLS_HOSTNAME */
"memory-backend-file.prealloc-threads", /* QEMU_CAPS_MEMORY_BACKEND_PREALLOC_THREADS */
);
@ -1766,6 +1767,7 @@ static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsMemoryBackendFile[] =
* released qemu versions. */
{ "x-use-canonical-path-for-ramblock-id", QEMU_CAPS_X_USE_CANONICAL_PATH_FOR_RAMBLOCK_ID },
{ "reserve", QEMU_CAPS_MEMORY_BACKEND_RESERVE },
{ "prealloc-threads", QEMU_CAPS_MEMORY_BACKEND_PREALLOC_THREADS },
};
static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsMemoryBackendMemfd[] = {

View File

@ -643,6 +643,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for syntax-check */
/* 425 */
QEMU_CAPS_BLOCKDEV_NBD_TLS_HOSTNAME, /* tls hostname can be overriden for NBD clients */
QEMU_CAPS_MEMORY_BACKEND_PREALLOC_THREADS, /* -object memory-backend-*.prealloc-threads */
QEMU_CAPS_LAST /* this must always be the last item */
} virQEMUCapsFlags;

View File

@ -178,6 +178,7 @@
<flag name='input-linux'/>
<flag name='query-display-options'/>
<flag name='virtio-blk.queue-size'/>
<flag name='memory-backend-file.prealloc-threads'/>
<version>5000000</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>61700241</microcodeVersion>

View File

@ -186,6 +186,7 @@
<flag name='input-linux'/>
<flag name='query-display-options'/>
<flag name='virtio-blk.queue-size'/>
<flag name='memory-backend-file.prealloc-threads'/>
<version>5000000</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>42900241</microcodeVersion>

View File

@ -170,6 +170,7 @@
<flag name='input-linux'/>
<flag name='query-display-options'/>
<flag name='virtio-blk.queue-size'/>
<flag name='memory-backend-file.prealloc-threads'/>
<version>5000000</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>0</microcodeVersion>

View File

@ -219,6 +219,7 @@
<flag name='input-linux'/>
<flag name='query-display-options'/>
<flag name='virtio-blk.queue-size'/>
<flag name='memory-backend-file.prealloc-threads'/>
<version>5000000</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>43100241</microcodeVersion>

View File

@ -90,6 +90,7 @@
<flag name='rotation-rate'/>
<flag name='input-linux'/>
<flag name='query-display-options'/>
<flag name='memory-backend-file.prealloc-threads'/>
<version>5001000</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>0</microcodeVersion>

View File

@ -222,6 +222,7 @@
<flag name='query-display-options'/>
<flag name='virtio-blk.queue-size'/>
<flag name='virtio-mem-pci'/>
<flag name='memory-backend-file.prealloc-threads'/>
<version>5001000</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>43100242</microcodeVersion>

View File

@ -184,6 +184,7 @@
<flag name='virtio-blk.queue-size'/>
<flag name='query-dirty-rate'/>
<flag name='calc-dirty-rate'/>
<flag name='memory-backend-file.prealloc-threads'/>
<version>5002000</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>61700243</microcodeVersion>

View File

@ -190,6 +190,7 @@
<flag name='virtio-blk.queue-size'/>
<flag name='query-dirty-rate'/>
<flag name='calc-dirty-rate'/>
<flag name='memory-backend-file.prealloc-threads'/>
<version>5002000</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>42900243</microcodeVersion>

View File

@ -174,6 +174,7 @@
<flag name='virtio-blk.queue-size'/>
<flag name='query-dirty-rate'/>
<flag name='calc-dirty-rate'/>
<flag name='memory-backend-file.prealloc-threads'/>
<version>5002000</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>0</microcodeVersion>

View File

@ -141,6 +141,7 @@
<flag name='virtio-blk.queue-size'/>
<flag name='query-dirty-rate'/>
<flag name='calc-dirty-rate'/>
<flag name='memory-backend-file.prealloc-threads'/>
<version>5002000</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>39100243</microcodeVersion>

View File

@ -226,6 +226,7 @@
<flag name='piix4.acpi-root-pci-hotplug'/>
<flag name='query-dirty-rate'/>
<flag name='calc-dirty-rate'/>
<flag name='memory-backend-file.prealloc-threads'/>
<version>5002000</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>43100243</microcodeVersion>

View File

@ -192,6 +192,7 @@
<flag name='virtio-blk.queue-size'/>
<flag name='query-dirty-rate'/>
<flag name='calc-dirty-rate'/>
<flag name='memory-backend-file.prealloc-threads'/>
<version>6000000</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>61700242</microcodeVersion>

View File

@ -149,6 +149,7 @@
<flag name='virtio-blk.queue-size'/>
<flag name='query-dirty-rate'/>
<flag name='calc-dirty-rate'/>
<flag name='memory-backend-file.prealloc-threads'/>
<version>6000000</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>39100242</microcodeVersion>

View File

@ -235,6 +235,7 @@
<flag name='query-dirty-rate'/>
<flag name='sev-inject-launch-secret'/>
<flag name='calc-dirty-rate'/>
<flag name='memory-backend-file.prealloc-threads'/>
<version>6000000</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>43100242</microcodeVersion>

View File

@ -239,6 +239,7 @@
<flag name='rbd-encryption'/>
<flag name='sev-inject-launch-secret'/>
<flag name='calc-dirty-rate'/>
<flag name='memory-backend-file.prealloc-threads'/>
<version>6001000</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>43100243</microcodeVersion>

View File

@ -203,6 +203,7 @@
<flag name='query-dirty-rate'/>
<flag name='rbd-encryption'/>
<flag name='calc-dirty-rate'/>
<flag name='memory-backend-file.prealloc-threads'/>
<version>6001050</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>61700244</microcodeVersion>

View File

@ -201,6 +201,7 @@
<flag name='sev-guest-kernel-hashes'/>
<flag name='calc-dirty-rate'/>
<flag name='dirtyrate-param.mode'/>
<flag name='memory-backend-file.prealloc-threads'/>
<version>6002000</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>42900244</microcodeVersion>

View File

@ -241,6 +241,7 @@
<flag name='sev-inject-launch-secret'/>
<flag name='calc-dirty-rate'/>
<flag name='dirtyrate-param.mode'/>
<flag name='memory-backend-file.prealloc-threads'/>
<version>6002000</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>43100244</microcodeVersion>

View File

@ -202,6 +202,7 @@
<flag name='device.json+hotplug'/>
<flag name='calc-dirty-rate'/>
<flag name='dirtyrate-param.mode'/>
<flag name='memory-backend-file.prealloc-threads'/>
<version>6002050</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>42900243</microcodeVersion>

View File

@ -244,6 +244,7 @@
<flag name='calc-dirty-rate'/>
<flag name='dirtyrate-param.mode'/>
<flag name='blockdev.nbd.tls-hostname'/>
<flag name='memory-backend-file.prealloc-threads'/>
<version>6002050</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>43100243</microcodeVersion>