- virsh # attach-disk vmsample /usr/local/CentOS-5.6-x86_64/CentOS-5.6-x86_64-bin-2of8.iso hdb --type cdrom --mode readonly --sourcetype file
-
error: Failed to attach disk
-
error: operation failed: could not change media on ide0-cd1: Could not open '/usr/local/CentOS-5.6-x86_64/CentOS-5.6-x86_64-bin-2of8.iso
打开审核:
semodule -DB
tail -f /var/log/audit/audit.log
type=AVC msg=audit(1312250683.885:166363): avc: denied { write } for pid=32281 comm="qemu-kvm" name="CentOS-5.6-x86_64-bin-2of8.iso" dev=sda5 ino=47054858 scontext=system_u:system_r:svirt_t:s0:c661,c697 tcontext=system_u:object_r:virt_content_t:s0 tclass=file
type=SYSCALL msg=audit(1312250683.885:166363): arch=c000003e syscall=2 success=no exit=-13 a0=1fd010d0 a1=1002 a2=0 a3=1 items=0 ppid=1 pid=32281 auid=508 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=23312 comm="qemu-kvm" exe="/usr/libexec/qemu-kvm" subj=system_u:system_r:svirt_t:s0:c661,c697 key=(null)
这是一个bug
BZ#Previously, when a CD image with a read-only flag set was ejected from a drive on a guest, the read-only flag was preserved. Consequently, the image could not be re-attached to the drive. A patch has been provided to address this issue, and the read-write flag is now set correctly when an image is ejected from a drive, allowing CD images to be changed on-the-fly
红帽已经给出了patch,但是需要访问rhn。
或者等到RHEL5.7解决这个问题。
或者关闭selinux。
阅读(3521) | 评论(0) | 转发(0) |