qemu: Generate command line for IOThread pool size

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
Michal Privoznik 2022-03-09 11:46:15 +01:00
parent 2bfb8159bb
commit 86c10f81e5
3 changed files with 53 additions and 2 deletions

View File

@ -7441,9 +7441,15 @@ qemuBuildIOThreadCommandLine(virCommand *cmd,
for (i = 0; i < def->niothreadids; i++) {
g_autoptr(virJSONValue) props = NULL;
g_autofree char *alias = g_strdup_printf("iothread%u", def->iothreadids[i]->iothread_id);
const virDomainIOThreadIDDef *iothread = def->iothreadids[i];
g_autofree char *alias = NULL;
if (qemuMonitorCreateObjectProps(&props, "iothread", alias, NULL) < 0)
alias = g_strdup_printf("iothread%u", iothread->iothread_id);
if (qemuMonitorCreateObjectProps(&props, "iothread", alias,
"k:thread-pool-min", iothread->thread_pool_min,
"k:thread-pool-max", iothread->thread_pool_max,
NULL) < 0)
return -1;
if (qemuBuildObjectCommandlineFromJSON(cmd, props, qemuCaps) < 0)

View File

@ -0,0 +1,44 @@
LC_ALL=C \
PATH=/bin \
HOME=/tmp/lib/domain--1-QEMUGuest1 \
USER=test \
LOGNAME=test \
XDG_DATA_HOME=/tmp/lib/domain--1-QEMUGuest1/.local/share \
XDG_CACHE_HOME=/tmp/lib/domain--1-QEMUGuest1/.cache \
XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
/usr/bin/qemu-system-x86_64 \
-name guest=QEMUGuest1,debug-threads=on \
-S \
-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/tmp/lib/domain--1-QEMUGuest1/master-key.aes"}' \
-machine q35,usb=off,dump-guest-core=off,memory-backend=pc.ram \
-accel tcg \
-cpu qemu64 \
-m 214 \
-object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}' \
-overcommit mem-lock=off \
-smp 6,sockets=6,cores=1,threads=1 \
-object '{"qom-type":"iothread","id":"iothread2","thread-pool-min":0,"thread-pool-max":60}' \
-object '{"qom-type":"iothread","id":"iothread4","thread-pool-min":1,"thread-pool-max":1}' \
-object '{"qom-type":"iothread","id":"iothread1"}' \
-object '{"qom-type":"iothread","id":"iothread3"}' \
-object '{"qom-type":"iothread","id":"iothread5"}' \
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
-display none \
-no-user-config \
-nodefaults \
-chardev socket,id=charmonitor,fd=1729,server=on,wait=off \
-mon chardev=charmonitor,id=monitor,mode=control \
-rtc base=utc \
-no-shutdown \
-no-acpi \
-boot strict=on \
-device '{"driver":"pcie-root-port","port":8,"chassis":1,"id":"pci.1","bus":"pcie.0","multifunction":true,"addr":"0x1"}' \
-device '{"driver":"pcie-root-port","port":9,"chassis":2,"id":"pci.2","bus":"pcie.0","addr":"0x1.0x1"}' \
-device '{"driver":"pcie-root-port","port":10,"chassis":3,"id":"pci.3","bus":"pcie.0","addr":"0x1.0x2"}' \
-device '{"driver":"qemu-xhci","id":"usb","bus":"pci.1","addr":"0x0"}' \
-blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest1","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}' \
-blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \
-device '{"driver":"virtio-blk-pci","bus":"pci.2","addr":"0x0","drive":"libvirt-1-format","id":"virtio-disk0","bootindex":1}' \
-audiodev '{"id":"audio1","driver":"none"}' \
-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
-msg timestamp=on

View File

@ -2038,6 +2038,7 @@ mymain(void)
DO_TEST("iothreads", QEMU_CAPS_OBJECT_IOTHREAD);
DO_TEST("iothreads-ids", QEMU_CAPS_OBJECT_IOTHREAD);
DO_TEST("iothreads-ids-partial", QEMU_CAPS_OBJECT_IOTHREAD);
DO_TEST_CAPS_LATEST("iothreads-ids-pool-sizes");
DO_TEST_FAILURE_NOCAPS("iothreads-nocap");
DO_TEST("iothreads-disk", QEMU_CAPS_OBJECT_IOTHREAD);
DO_TEST("iothreads-disk-virtio-ccw", QEMU_CAPS_OBJECT_IOTHREAD,