Bug 1741832

Summary: [cgroup_v2]When disable 'io' controller, the error message is code-level when try to set values to blk related params
Product: Red Hat Enterprise Linux 8 Reporter: yisun
Component: libvirtAssignee: Pavel Hrdina <phrdina>
Status: CLOSED DEFERRED QA Contact: yisun
Severity: low Docs Contact:
Priority: unspecified    
Version: 8.1CC: phrdina, rbalakri, yalzhang, yisun
Target Milestone: rc   
Target Release: 8.0   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1734625 Environment:
Last Closed: 2020-03-10 12:09:44 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1734625    
Bug Blocks:    

Description yisun 2019-08-16 08:11:31 UTC
+++ This bug was initially created as a clone of Bug #1734625 +++

Description:
When disable 'io' controller, the error message is code-level when try to set values to blk related params

Versions:
libvirt-5.5.0-2.module+el8.1.0+3773+7dd501bf.x86_64

How reproducible:
100%

Pls note:
This is a regression but not a serious issue.
And happens with cgroup v1 and v2.

Steps:
1. Disable blkio controller with qemu.conf
$ cat /etc/libvirt/qemu.conf | grep "^cgroup"
cgroup_controllers = [ "cpu", "devices", "memory", "cpuset", "cpuacct" ]

$ systemctl restart libvirtd

2. Try to use 'blkiotune' cmd to set values to some params
$ virsh blkiotune avocado-vt-vm1 --device-read-iops-sec /dev/sda,330 --device-write-iops-sec /dev/sda,293
error: Unable to change blkio parameters
error: internal error: failed to get cgroup backend for 'setBlkioDeviceWriteIops'

$ virsh blkiotune avocado-vt-vm1 --device-weights /dev/sda,100
error: Unable to change blkio parameters
error: internal error: failed to get cgroup backend for 'setBlkioDeviceWeight'

$ virsh blkiotune avocado-vt-vm1 --weight 100
error: Unable to change blkio parameters
error: internal error: failed to get cgroup backend for 'setBlkioWeight'
<==== we can see these "internal error" is code level, not suitable for end-user

Additional info:
1. When just try to getting the values, the error message is clear
 virsh blkiotune avocado-vt-vm1
error: Unable to get blkio parameters
error: Requested operation is not valid: blkio cgroup isn't mounted

2. other controllers don't have this problem.

3. With rhel7.7 libvirt-4.5.0-23.el7.x86_64, the error message is clear
# virsh blkiotune avocado-vt-vm1 --weight 100
error: Unable to change blkio parameters
error: internal error: Controller 'blkio' is not mounted

3

Expected result:
Should keep the error message as before.

Comment 1 yisun 2019-08-16 08:18:50 UTC
reproduced on: libvirt-4.5.0-31.module+el8.1.0+3808+3325c1a3.x86_64
so clone to rhel8.1 branch

Comment 2 Pavel Hrdina 2020-03-10 12:09:44 UTC
I don't think this is critical enough to backport it to RHEL.  There is a separate BZ for RHEL-AV where it will eventually get by rebase once we address this issue in upstream and it will eventually get into RHEL as well.  The error message is not ideal but it's good enough to figure out that cgroups are not working.