Description of problem: As subject Version-Release number of selected component (if applicable): libvirt-8.5.0-5.el9.x86_64 qemu-kvm-7.0.0-11.el9.x86_64 How reproducible: 100% Steps to Reproduce: 1. Prepare an inactive VM with iothreads. The XML will be like: ... <iothreads>4</iothreads> <iothread id="2"/> <iothread id="4"/> <iothread id="6"/> <iothread id="8" thread_pool_min="1" thread_pool_max="120"/> ... 2. Set the poll-max-ns by `virsh iothreadset --config` ➜ ~ virsh iothreadset rhel 2 --poll-max-ns 2 --config error: Operation not supported: configuring persistent polling values is not supported Actual results: As above Expected results: poll-max-ns could be set like what we did for thread-pool-min in https://bugzilla.redhat.com/show_bug.cgi?id=2059511#c30 Additional info: Here is a qemu example to set poll-max-ns by qemu cmdline: ➜ ~ /usr/libexec/qemu-kvm -object '{"qom-type":"iothread","id":"iothread2", "poll-max-ns": 2}' --qmp tcp:localhost:4444,server,wait=off qemu-kvm: Machine type 'pc-i440fx-rhel7.6.0' is deprecated: machine types for previous major releases are deprecated qemu-kvm: warning: CPU model qemu64-x86_64-cpu is deprecated -- use at least 'Nehalem' / 'Opteron_G4', or 'host' / 'max' VNC server running on ::1:5900 Then connect qmp socket and get the iothreads info: ➜ ~ nc localhost 4444 {"QMP": {"version": {"qemu": {"micro": 0, "minor": 0, "major": 7}, "package": "qemu-kvm-7.0.0-11.el9"}, "capabilities": ["oob"]}} { "execute": "qmp_capabilities" } {"return": {}} { "execute": "query-iothreads"} {"return": [{"poll-shrink": 0, "thread-id": 6877, "aio-max-batch": 0, "poll-grow": 0, "poll-max-ns": 2, "id": "iothread2"}]} It works for poll-max-ns. We can support setting the poll attributes poll-max-ns/poll-grow/poll-shrink by the domain XML or `virsh iothreadset --config`
For now libvirt didn't represent the values in XML.
Implemented as part of https://listman.redhat.com/archives/libvir-list/2023-March/238250.html
Fixed upstream: commit 4b5a9e34ad36872ffb941772d86a210e36753de2 Author: Peter Krempa <pkrempa> Date: Thu Feb 23 14:27:17 2023 +0100 qemu: Use configured iothread poll parameters on startup Implement the support for the persisted poll parameters and remove restrictions on saving config when modifying them during runtime. Signed-off-by: Peter Krempa <pkrempa> Reviewed-by: Ján Tomko <jtomko> commit 83eee66f811cc81c632738b84129f006035a88d0 Author: Peter Krempa <pkrempa> Date: Thu Feb 23 13:48:35 2023 +0100 conf: Store the iothread 'poll' settings in the XML Currently we allow configuring the 'poll-max-ns', 'poll-grow', and 'poll-shrink' parameters of qemu iothreads only during runtime and they are not persisted. Add XML machinery to persist them. Signed-off-by: Peter Krempa <pkrempa> Reviewed-by: Ján Tomko <jtomko> v9.3.0-26-g4b5a9e34ad
Tested on v9.3.0-62-g4a681995bc, qemu-kvm-8.0.0-2.el9.x86_64: 1. Define a VM with iothreads ➜ xmllint --xpath //iothreadids rhel.xml <iothreadids> <iothread id="2"/> <iothread id="4"/> <iothread id="6"/> <iothread id="8" thread_pool_min="2" thread_pool_max="32"> <poll max="123" grow="456" shrink="789"/> </iothread> </iothreadids> ➜ /root/libvirt/build/tools/virsh define rhel.xml Domain 'rhel' defined from rhel.xml 2. Set the iothread attributes inactively: ➜ virsh iothreadset rhel 6 --poll-max-ns 222 --poll-grow 222 --poll-shrink 222 --config ➜ /root/libvirt/build/tools/virsh dumpxml rhel --xpath //iothreadids <iothreadids> <iothread id="2"/> <iothread id="4"/> <iothread id="6"> <poll max="222" grow="222" shrink="222"/> </iothread> <iothread id="8" thread_pool_min="2" thread_pool_max="32"> <poll max="123" grow="456" shrink="789"/> </iothread> </iothreadids> 3. Start the domain and check the iothreads: ➜ /root/libvirt/build/tools/virsh start rhel Domain 'rhel' started ➜ /root/libvirt/build/tools/virsh domstats rhel|grep iothread iothread.count=4 iothread.2.poll-max-ns=32768 iothread.2.poll-grow=0 iothread.2.poll-shrink=0 iothread.4.poll-max-ns=32768 iothread.4.poll-grow=0 iothread.4.poll-shrink=0 iothread.6.poll-max-ns=222 iothread.6.poll-grow=222 iothread.6.poll-shrink=222 iothread.8.poll-max-ns=123 iothread.8.poll-grow=456 iothread.8.poll-shrink=789
Test as comment5 on libvirt-9.5.0-0rc1.1.el9.x86_64 qemu-kvm-8.0.0-6.el9.x86_64. PASS
Tested on libvirt-9.5.0-5.el9.x86_64 qemu-kvm-8.0.0-11.el9.x86_64 as comment5. PASS