Hi Daniel,
I noticed that the patch "Add support for hotplug/unplug of disk devices in LXC"
you wrote had been merged into libvirt of version 1.0.2.
But when I used this function, it report an error with details as following:
ubuntu@lxc:~$ vir attach-device instance-0000002c disk.xml --config
error: Failed to attach device from disk.xml
error: Unable to create device /proc/18377/root/dev/sdb: Permission denied
ubuntu@lxc:~$ vir attach-device instance-0000002c disk.xml
error: Failed to attach device from disk.xml
error: Unable to create device /proc/18377/root/dev/sdb: Permission denied
ubuntu@lxc:~$ cat disk.xml
<disk type='block' device='disk'>
<driver type='raw' cache='none'/>
<source dev='/dev/dm-0'/>
<target dev='sdb' bus='scsi'/>
</disk>
ubuntu@lxc:~$ ll /dev/dm-0
brw-rw---- 1 root disk 252, 0 Jul 15 03:39 /dev/dm-0
ubuntu@lxc:~$ dpkg -l|grep libvirt
ii libvirt-bin 1.0.2-0ubuntu11 programs
for the libvirt library
ii libvirt0 1.0.2-0ubuntu11 library
for interfacing with different virtualization systems
ii python-libvirt 1.0.2-0ubuntu11 libvirt
Python bindings
And in this lxc vm, through dmesg the following information can be seen:
ubuntu@lxc2:~$ dmesg
[433287.227288] type=1400 audit(1373874475.861:55): apparmor="DENIED"
operation="mknod" info="Failed name lookup" error=-13 parent=1
profile="/usr/sbin/libvirtd" name="dev/sdb" pid=1541
comm="libvirtd" requested_mask="c" denied_mask="c" fsuid=0
ouid=0
What's the real problem and How can I fix it. I really appreciate your help.
Thanks!
--------------
Best regards!
GuanQiang
2013-07-15