Hi experts:
When I did some test, I was puzzled by one thing: When I use "virsh update-device" to update floppy device, always got an error message, "error: internal error unable to execute QEMU command 'change': Could not open'***file':Permission denied".But when I execute command "setenforce 0"
befroe "udpate-device", floppy device can be updated.

Steps like this:
---------------------------------------------------------------Start
# virsh start virt-tests-vm1
Domain virt-tests-vm1 started

# cat /add_storage/liyang/github-autotest_new/client/tests/virt/tmp/tmp/update_iso.xml
<disk type='file' device='floppy'>
<driver name='qemu' type='raw'/>
<source file='/add_storage/liyang/github-autotest_new/client/tests/virt/tmp/tmp/change_media_old.iso'/>
<target dev='fda'/>
<readonly/>
</disk>
# ll /add_storage/liyang/github-autotest_new/client/tests/virt/tmp/tmp/change_media_old.iso -rw-r--r--. 1 qemu qemu 1404928 Sep 20 10:48 /add_storage/liyang/github-autotest_new/client/tests/virt/tmp/tmp/change_media_old.iso # virsh update-device virt-tests-vm1 /add_storage/liyang/github-autotest_new/client/tests/virt/tmp/tmp/update_iso.xml --force error: Failed to update device from /add_storage/liyang/github-autotest_new/client/tests/virt/tmp/tmp/update_iso.xml error: internal error unable to execute QEMU command 'change': Could not open '/add_storage/liyang/github-autotest_new/client/tests/virt/tmp/tmp/change_media_old.iso': Permission denied

# cat /selinux/enforce
1
# setenforce 0
# virsh update-device virt-tests-vm1 /add_storage/liyang/github-autotest_new/client/tests/virt/tmp/tmp/update_iso.xml --force
Device updated successfully
---------------------------------------------------------------End

But with same command, about cdrom device it worked though "/selinux/enforce" is 1.
Steps like this:
---------------------------------------------------------------Start
# virsh start virt-tests-vm1
Domain virt-tests-vm1 started

# cat /add_storage/liyang/github-autotest_new/client/tests/virt/tmp/tmp/update_iso.xml

<disk type='file' device='cdrom'>
<driver name='qemu' type='raw'/>
<source file='/add_storage/liyang/github-autotest_new/client/tests/virt/tmp/tmp/change_media_old.iso'/>
<target dev='hdc'/>
<readonly/>
</disk>
# ll /add_storage/liyang/github-autotest_new/client/tests/virt/tmp/tmp/change_media_old.iso -rw-r--r--. 1 qemu qemu 1404928 Sep 20 10:58 /add_storage/liyang/github-autotest_new/client/tests/virt/tmp/tmp/change_media_old.iso
# cat /selinux/enforce
1
# virsh update-device virt-tests-vm1 /add_storage/liyang/github-autotest_new/client/tests/virt/tmp/tmp/update_iso.xml --force
Device updated successfully
---------------------------------------------------------------End

So I want to know why it's different between 'floppy' and 'cdrom', and what's the difference?
Also why floppy needs 'permissive' mode but cdrom doesn't?

Wish your help!

--
Regards,
--------------------------------------------------
Li Yang
TEL:+86+25-86630566-8529
EMail:liyang.f...@cn.fujitsu.com
--------------------------------------------------



--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Reply via email to