qemu: Generate command line for <defaultiothread/> pool size

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>
This commit is contained in:
Michal Privoznik 2022-05-16 14:16:06 +02:00
parent 94b71589f1
commit 425d3b12a4
2 changed files with 14 additions and 3 deletions

View 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;
}

View 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 \