Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Description of problem:
Libvirt doesn't put hot-plug disk device into cgroup device ACL whitelisting,
the hot-pluge disk with a backing file pointing at a host device/partition.
Version-Release number of selected component (if applicable):
# uname -r
2.6.32-120.el6.x86_64
# rpm -q libvirt
libvirt-0.8.7-11.el6.x86_64
# rpm -q qemu-kvm
qemu-kvm-0.12.1.2-2.150.el6.x86_64
# rpm -q libcgroup
libcgroup-0.37-1.el6.x86_64
How reproducible:
always
Steps to Reproduce:
1. install a guest
2. create a qcow2 disk image
3. let the disk image point to at a host device/partition
4. attach the disk image to running guest
5. check whether host device/partition major:minor number appear in devices.list
Actual results:
can't grep host device/partition major:minor number in devices.list
Expected results:
fix it.
Additional info:
The following log comes virsh-rail test suite:
(git clone git+ssh://git.nay.redhat.com/~/repo/libvirt/virsh-rail)
# sh virsh-rail cases/qemu/functional/guest-resource-control/hot-qcow2-hostdevice.tc
--------------[ step1: domain_install ]--------------------------------------
[2011-03-14 17:21:52] INFO (cases/qemu/functional/guest-resource-control/hot-qcow2-hostdevice.tc:118) creating disk with qcow2 type
......
[2011-03-14 17:31:44] INFO (cases/qemu/functional/guest-resource-control/hot-qcow2-hostdevice.tc:245) Linux guest boot up successfully
--------------[ PASS ]-------------------------------------------------------
--------------[ step2: create_image ]----------------------------------------
[2011-03-14 17:31:44] DEBUG (cases/qemu/functional/guest-resource-control/hot-qcow2-hostdevice.tc:689) Received parameters: format=qcow2 image_path=/var/lib/libvirt/images/foo.img image_size=6G other_options=-o backing_file=/dev/sda
[2011-03-14 17:31:44] INFO (cases/qemu/functional/guest-resource-control/hot-qcow2-hostdevice.tc:705) The image is created successfully.
Formatting '/var/lib/libvirt/images/foo.img', fmt=qcow2 size=6442450944 backing_file='/dev/sda' encryption=off cluster_size=0
--------------[ PASS ]------------------------------------------------------
----------[ step3: domain_attach_device]------------------------------------
[2011-03-14 17:31:44] DEBUG (cases/qemu/functional/guest-resource-control/hot-qcow2-hostdevice.tc:2184) Received parameters: domain_name=vr-rhel6-x86_64-kvm element_block=disk disk_type=file disk_device=disk driver_name=qemu disk_format=qcow2 source_file=/var/lib/libvirt/images/vr-rhel6-x86_64-kvm target_dev=vdb target_bus=virtio
[2011-03-14 17:31:44] DEBUG (cases/qemu/functional/guest-resource-control/hot-qcow2-hostdevice.tc:2229) Original disk number: 1
[2011-03-14 17:31:45] DEBUG (cases/qemu/functional/guest-resource-control/hot-qcow2-hostdevice.tc:2237) XML file /tmp/tmp.vD3ua9EUL2: <disk type='file' device='disk'>
<driver name='qemu' type='qcow2'/>
<source file='/var/lib/libvirt/images/vr-rhel6-x86_64-kvm'/>
<target dev='vdb' bus='virtio'/>
</disk>
[2011-03-14 17:31:45] INFO (cases/qemu/functional/guest-resource-control/hot-qcow2-hostdevice.tc:2239) Attach device to vr-rhel6-x86_64-kvm
[2011-03-14 17:31:45] INFO (cases/qemu/functional/guest-resource-control/hot-qcow2-hostdevice.tc:2251) Device attached successfully
--------------[ PASS ]------------------------------------------------------
----[ step4: virt_cgroup_devices_check ]------------------------------------
[2011-03-14 17:31:45] DEBUG (cases/qemu/functional/guest-resource-control/hot-qcow2-hostdevice.tc:191) Received parameters: domain_name=vr-rhel6-x86_64-kvm host_device=/dev/sda
[2011-03-14 17:31:45] INFO (cases/qemu/functional/guest-resource-control/hot-qcow2-hostdevice.tc:204) /dev/sda major:minor=8:0
[2011-03-14 17:31:45] ERROR (cases/qemu/functional/guest-resource-control/hot-qcow2-hostdevice.tc:213) virt_cgroup_devices_check: Failed to grep 8:0 in /cgroup/devices/libvirt/qemu/vr-rhel6-x86_64-kvm/devices.list
--------------[ FAIL ]------------------------------------------------------