Description: [cgroup_v2] Error happened and xml not changed when use blkiotune to set blk cgroup values Versions: libvirt-5.5.0-2.module+el8.1.0+3773+7dd501bf.x86_64 How reproducible: 100% Steps: 0. Enable cgroup v2 1. Having block device /dev/sda on host: [root@ibm-x3250m6-06 ~]# lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 931.5G 0 disk ... 2. Use blkiotune to set "--device-read-iops-sec" to a running vm [root@ibm-x3250m6-06 ~]# virsh blkiotune avocado-vt-vm1 --device-read-iops-sec /dev/sda,1234 error: Unable to change blkio parameters error: internal error: Unable to parse 'rbps=max wbps=max riops=1234 wiops=max' as an integer <==== error produced [root@ibm-x3250m6-06 ~]# virsh dumpxml avocado-vt-vm1 | grep 1234 | wc -l 0 <==== xml not changed [root@ibm-x3250m6-06 ~]# cat /sys/fs/cgroup/machine.slice/machine-qemu\\x2d1\\x2davocado\\x2dvt\\x2dvm1.scope/io.max 8:0 rbps=max wbps=max riops=1234 wiops=max <==== but corresponding cgroup controller value changed as expected 3. set "--device-read-bytes-sec", same as step 2 [root@ibm-x3250m6-06 ~]# virsh blkiotune avocado-vt-vm1 --device-read-bytes-sec /dev/sda,5678 error: Unable to change blkio parameters error: internal error: Unable to parse 'rbps=5678 wbps=max riops=1234 wiops=4321' as an integer [root@ibm-x3250m6-06 ~]# virsh dumpxml avocado-vt-vm1 | grep 5678 | wc -l 0 [root@ibm-x3250m6-06 ~]# cat /sys/fs/cgroup/machine.slice/machine-qemu\\x2d1\\x2davocado\\x2dvt\\x2dvm1.scope/io.max 8:0 rbps=5678 wbps=max riops=1234 wiops=4321 4. set "--device-write-bytes-sec", same as step 2 [root@ibm-x3250m6-06 ~]# virsh blkiotune avocado-vt-vm1 --device-write-bytes-sec /dev/sda,8765 error: Unable to change blkio parameters error: internal error: Unable to parse 'rbps=5678 wbps=8765 riops=1234 wiops=4321' as an integer [root@ibm-x3250m6-06 ~]# virsh dumpxml avocado-vt-vm1 | grep 8765 | wc -l 0 [root@ibm-x3250m6-06 ~]# cat /sys/fs/cgroup/machine.slice/machine-qemu\\x2d1\\x2davocado\\x2dvt\\x2dvm1.scope/io.max 8:0 rbps=5678 wbps=8765 riops=1234 wiops=4321 5. setting "--device-write-iops-sec" is OK [root@ibm-x3250m6-06 ~]# virsh blkiotune avocado-vt-vm1 --device-write-iops-sec /dev/sda,4321 [root@ibm-x3250m6-06 ~]# cat /sys/fs/cgroup/machine.slice/machine-qemu\\x2d1\\x2davocado\\x2dvt\\x2dvm1.scope/io.max 8:0 rbps=max wbps=max riops=1234 wiops=4321 [root@ibm-x3250m6-06 ~]# virsh dumpxml avocado-vt-vm1 | grep 4321 | wc -l 1 Expected result: No error happened and xml should be changed correctly.
When set 2 or more devices concurrently, the error will block the 2nd and rest settings, as follow: $ lsblk | egrep "sda |sdb " sda 8:0 0 465.8G 0 disk sdb 8:16 0 1000M 0 disk $ pwd /sys/fs/cgroup/machine.slice/machine-qemu\x2d9\x2davocado\x2dvt\x2dvm1.scope $ virsh blkiotune avocado-vt-vm1 --device-read-iops-sec /dev/sda,321321,/dev/sdb,123123 error: Unable to change blkio parameters error: internal error: Unable to parse 'rbps=max wbps=max riops=321321 wiops=max' as an integer $ cat io.max 8:0 rbps=max wbps=max riops=321321 wiops=max <===== here, only the /dev/sda setting takes effect.
PASSED in auto test job with libvirt-5.6.0-5.module+el8.1.0+4229+2e4e348c.x86_64: https://libvirt-jenkins.rhev-ci-vms.eng.rdu2.redhat.com/job/libvirt-RHEL-8.1-runtest-x86_64-function-guest_resource_control/10/testReport/ (the single failed case is a script issue, not related to this bz)
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:3723