Bug 684718 - Libvirt doesn't put hot-plug disk device into cgroup device ACL whitelisting
Summary: Libvirt doesn't put hot-plug disk device into cgroup device ACL whitelisting
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt
Version: 6.1
Hardware: x86_64
OS: Linux
high
high
Target Milestone: rc
: ---
Assignee: Daniel Veillard
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-03-14 10:32 UTC by Alex Jia
Modified: 2011-03-14 10:54 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-03-14 10:53:00 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description Alex Jia 2011-03-14 10:32:38 UTC
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 ]------------------------------------------------------

Comment 1 Alex Jia 2011-03-14 10:54:26 UTC
Error attach guest image vr-rhel6-x86_64-kvm to guest, so it's not a bug.


Note You need to log in before you can comment on or make changes to this bug.