Hide Forgot
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 ]------------------------------------------------------
Error attach guest image vr-rhel6-x86_64-kvm to guest, so it's not a bug.