Hide Forgot
Description of problem: After excute update-device comman CDROM device have not be updated. Version-Release number of selected component (if applicable): libvirt-0.8.2-18.el5 xen-3.0.3-127.el5 kernel-xen-2.6.18-252.el5 How reproducible: 5/5 Steps to Reproduce: 1. Prepare 2 different ISO files. Create temp1.iso and temp2.iso # mkisofs -o /var/lib/xen/images/temp1.iso /tmp Do some changes in /tmp directory, such as, add/change/remove some new file to make a different iso file # mkisofs -o /var/lib/xen/images/temp2.iso /tmp 2. Define a guest with a cdrom devcie witch is connected with temp1.iso. Make sure the following is seen in your domain xml file. <disk type='file' device='cdrom'> <driver name='file' /> <source file='/var/lib/xen/images/temp1.iso'/> <target dev='hdc' bus='ide'/> <readonly/> </disk> 3. Prepare a xml as following: <disk type='file' device='cdrom'> <driver name='file' /> <source file='/var/lib/xen/images/temp2.iso'/> <target dev='hdc' bus='ide'/> <readonly/> </disk> 4. When doaming is inactive, try to update the media in cdrom device. # virsh list --all Id Name State ---------------------------------- 0 Domain-0 running 36 r5.6 idle 5.Login guest r5.6 to check CDROM. # mount /dev/cdrom /media # ls /media 6.# virsh update-device r5.6 cdrom.xml Device updated successfully 7.Login guest r5.6 to check CDROM. # mount /dev/cdrom /media # ls /media Actual results: Content of CDROM device have not be changed. Expected results: Content of CDROM device should be update to "temp2.iso"
Just to make things clear: you did umount /media before update-device, right? Because I am able to reproduce this bug only without unmounting.
Created attachment 495549 [details] run without mounted cdrom
Created attachment 495550 [details] run with mounter cdrom
I belive this is XEN bug, as we can see from attachments. I've added some debug printings to see communication between libvirt <-> xen. From the first attachement we can see changing cdrom without being mounted in guest. It works well and xen returns code 200 OK. From the 2nd attachement we can see how things went wrong. The cdrom was mounted, and update-device was run afterwards. Xen returned 200 OK, which is why libvirt responded "Device updated successfully".
According to comment4, change component to "xen" and continue to track this issue.
This behavior is partly correct. When cdrom is mounted, device won't be changed. However, this block is not propagated to xenstore as it is done in qemu. This should be change.
Change of cdrom uses asynchronous xenstore way so there's no way to propagate error into caller. Possible solution is to prevent xenstore change using some flag. However, upstream does not solve this problem and developing such a solution is out of xen support scope in rhel. As this is internally reported problem and it's not critical issue, we won't fix current behavior.