[PATCH v2 14/15] qemu_validate: Check if QEMU's capable of setting main loop pool size

Michal Privoznik mprivozn at redhat.com
Tue Jun 7 12:52:58 UTC 2022


Since the main-loop and iothread classes are derived from the
same class (EventLoopBaseClass) we don't need new capability and
can use QEMU_CAPS_IOTHREAD_THREAD_POOL_MAX directly to check
whether QEMU's capable of setting worker pool size.

Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
---
 src/qemu/qemu_validate.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c
index 7d11ae2c92..c2495fb6b8 100644
--- a/src/qemu/qemu_validate.c
+++ b/src/qemu/qemu_validate.c
@@ -401,6 +401,15 @@ qemuValidateDomainDefIOThreads(const virDomainDef *def,
         }
     }
 
+    if (def->defaultIOThread &&
+        ((def->defaultIOThread->thread_pool_min >= 0 ||
+          def->defaultIOThread->thread_pool_max >= 0) &&
+         !virQEMUCapsGet(qemuCaps, QEMU_CAPS_IOTHREAD_THREAD_POOL_MAX))) {
+        virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+                       _("pool_min and pool_max is not supported by this QEMU binary"));
+        return -1;
+    }
+
     return 0;
 }
 
-- 
2.35.1



More information about the libvir-list mailing list