Description of problem: Cannot use setIOThreadParams() to set poll_shrink. Version-Release number of selected component (if applicable): python3-libvirt-5.0.0-2.module+el8+2780+89be6baf.x86_64 libvirt-5.0.0-3.module+el8+2807+8bbe0a41.x86_64 How reproducible 100% Steps to Reproduce: # python Python 3.6.8 (default, Jan 11 2019, 02:17:16) [GCC 8.2.1 20180905 (Red Hat 8.2.1-3)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import libvirt >>> conn = libvirt.open() >>> dom = conn.lookupByName('test') >>> dom.addIOThread(200, 0) 0 >>> dom_stats = conn.domainListGetStats([dom], libvirt.VIR_DOMAIN_STATS_IOTHREAD, 0) >>> dom_stats [(<libvirt.virDomain object at 0x7f9dd15bb550>, {'iothread.count': 1, 'iothread.200.poll-max-ns': 32768, 'iothread.200.poll-grow': 0, 'iothread.200.poll-shrink': 0})] >>> dom.setIOThreadParams(200, {'poll_shrink': 6}, 0) libvirt: error : invalid argument: invalid type 'ullong' for parameter 'poll_shrink', expected 'uint' Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib64/python3.6/site-packages/libvirt.py", line 2250, in setIOThreadParams if ret == -1: raise libvirtError ('virDomainSetIOThreadParams() failed', dom=self) libvirt.libvirtError: invalid argument: invalid type 'ullong' for parameter 'poll_shrink', expected 'uint' >>> Actual results: Set failed. Expected results: Set poll_shrink successful. Additional info: The type of poll_shrink in libvirt-python is different in libvirt. Line 1687 in libvirt-python-5.0.0-2/libvirt-override.c. static virPyTypedParamsHint virPyDomainSetIOThreadParams[] = { { VIR_DOMAIN_IOTHREAD_POLL_MAX_NS, VIR_TYPED_PARAM_ULLONG }, { VIR_DOMAIN_IOTHREAD_POLL_GROW, VIR_TYPED_PARAM_UINT }, { VIR_DOMAIN_IOTHREAD_POLL_SHRINK, VIR_TYPED_PARAM_ULLONG }, }; Line 6156 in libvirt/src/qemu/qemu_driver.c. 6144qemuDomainIOThreadParseParams(virTypedParameterPtr params, 6145 int nparams, 6146 qemuMonitorIOThreadInfoPtr iothread) ... 6150 if (virTypedParamsValidate(params, nparams, 6151 VIR_DOMAIN_IOTHREAD_POLL_MAX_NS, 6152 VIR_TYPED_PARAM_ULLONG, 6153 VIR_DOMAIN_IOTHREAD_POLL_GROW, 6154 VIR_TYPED_PARAM_UINT, 6155 VIR_DOMAIN_IOTHREAD_POLL_SHRINK, 6156 VIR_TYPED_PARAM_UINT, 6157 NULL) < 0)
Upstream commit: commit 878446e7f9fc1086b074d52c881e207021a11486 Author: Pavel Hrdina <phrdina> Date: Mon Feb 25 13:04:05 2019 +0100 Fix virDomainPinIOThread typed params check
Verified on python3-libvirt-5.0.0-3.module+el8+2836+c71eecaf.x86_64. The result is expected. Move to VERIFIED. # python Python 3.6.8 (default, Jan 11 2019, 02:17:16) [GCC 8.2.1 20180905 (Red Hat 8.2.1-3)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import libvirt >>> conn = libvirt.open() >>> dom = conn.lookupByName('test') >>> dom.addIOThread(200, 0) 0 >>> conn.domainListGetStats([dom], libvirt.VIR_DOMAIN_STATS_IOTHREAD, 0) [(<libvirt.virDomain object at 0x7fe15db6a9b0>, {'iothread.count': 1, 'iothread.200.poll-max-ns': 32768, 'iothread.200.poll-grow': 0, 'iothread.200.poll-shrink': 0})] >>> dom.setIOThreadParams(200, {'poll_shrink': 6}, 0) 0 >>> conn.domainListGetStats([dom], libvirt.VIR_DOMAIN_STATS_IOTHREAD, 0) [(<libvirt.virDomain object at 0x7fe15da50208>, {'iothread.count': 1, 'iothread.200.poll-max-ns': 32768, 'iothread.200.poll-grow': 0, 'iothread.200.poll-shrink': 6})]
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2019:1293