]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: Generate command line for <defaultiothread/> pool size
authorMichal Privoznik <mprivozn@redhat.com>
Mon, 16 May 2022 12:16:06 +0000 (14:16 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Fri, 10 Jun 2022 12:01:08 +0000 (14:01 +0200)
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2059511
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
src/qemu/qemu_command.c
tests/qemuxml2argvdata/iothreads-ids-pool-sizes.x86_64-latest.args

index 2734be767967a77df83df08a96614d7e9fdacdaf..be20053c0d6cbead23a861151d2ea8a42d51e214 100644 (file)
@@ -7436,9 +7436,6 @@ qemuBuildIOThreadCommandLine(virCommand *cmd,
 {
     size_t i;
 
-    if (def->niothreadids == 0)
-        return 0;
-
     for (i = 0; i < def->niothreadids; i++) {
         g_autoptr(virJSONValue) props = NULL;
         const virDomainIOThreadIDDef *iothread = def->iothreadids[i];
@@ -7456,6 +7453,19 @@ qemuBuildIOThreadCommandLine(virCommand *cmd,
             return -1;
     }
 
+    if (def->defaultIOThread) {
+        g_autoptr(virJSONValue) props = NULL;
+
+        if (qemuMonitorCreateObjectProps(&props, "main-loop", "main-loop",
+                                         "k:thread-pool-min", def->defaultIOThread->thread_pool_min,
+                                         "k:thread-pool-max", def->defaultIOThread->thread_pool_max,
+                                         NULL) < 0)
+            return -1;
+
+        if (qemuBuildObjectCommandlineFromJSON(cmd, props, qemuCaps) < 0)
+            return -1;
+    }
+
     return 0;
 }
 
index 32517e3d29e25afe33387aa85edbe73cf1d7bd29..12747b51f0f44b01b29fac56092b374e4f0ba5e3 100644 (file)
@@ -22,6 +22,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
 -object '{"qom-type":"iothread","id":"iothread1"}' \
 -object '{"qom-type":"iothread","id":"iothread3"}' \
 -object '{"qom-type":"iothread","id":"iothread5"}' \
+-object '{"qom-type":"main-loop","id":"main-loop","thread-pool-min":8,"thread-pool-max":16}' \
 -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
 -display none \
 -no-user-config \