Description of problem: qemu host cdrom support not properly updating guests on media changes at physical CD/DVD drives,this bug some like bug687900(rhel6 host).but this is reflect rhel5 host Version-Release number of selected component (if applicable): host: # uname -r 2.6.18-333.el5 # rpm -q kvm kvm-83-258.el5 gust: # uname -r 2.6.18-333.el5 How reproducible: 100% Steps to Reproduce: 1.boot guest with physical cdrom CLI:/usr/libexec/qemu-kvm -m 2G -smp 2 -cpu qemu64,+sse2 -drive file=/home/111.raw,format=raw,media=disk,if=boot=on,werror=stop -net nic,model=virtio,macaddr=04:16:37:51:37:27,vlan=0 -net tap,sndbuf=0,vlan=0,script=/etc/qemu-ifup,downscript=no -uuid `uuidgen` -vnc :18 -boot c -usbdevice tablet -no-hpet -rtc-td-hack -no-kvm-pit-reinjection -monitor stdio -balloon virtio -drive file=/dev/cdrom,media=cdrom,if=ide 2.in guest #df -lh Filesystem Size Used Avail Use% Mounted on /dev/mapper/VolGroup00-LogVol00 16G 2.6G 13G 18% / /dev/vda1 99M 18M 77M 19% /boot tmpfs 941M 0 941M 0% /dev/shm /dev/hda 624M 624M 0 100% /media/rhev-hypervisor #mount /dev/hda /mnt #cat /dev/block/hda/size 208468 3.in guest #cp -r /mnt/boot.bat /home----->work well 4.in host: #eject --->change anoter physical cdrom 5.in guest #df -lh Filesystem Size Used Avail Use% Mounted on /dev/mapper/VolGroup00-LogVol00 16G 2.6G 13G 18% / /dev/vda1 99M 18M 77M 19% /boot tmpfs 941M 0 941M 0% /dev/shm /dev/hda 624M 624M 0 100% /media/CRMEXFPP_EN #mount /dev/hda /mnt #cp -r support/ /home cp: reading `support/tools/dcdiag.exe': Input/output error cp: reading `support/tools/deploy.cab': Input/output error cp: reading `support/tools/fastwiz.exe': Input/output error cp: reading `support/tools/gbunicnv.exe': Input/output error cp: reading `support/tools/repadmin.exe': Input/output error cp: reading `support/tools/support.cab': Input/output error #cat /sys/block/hda/size 208468------>size not change for new cdrom,same as previous Actual results: after change another physical cdrom--then cp file ,will show Input/output error,can the physical cdrom size not change . Expected results: when change cdrom,cdrom size will change ,and "cp" not error Additional info:
For RHEL6/7 we suggest using SCSI passthrough for host CD-ROM access. For RHEL5 we do not have a solution, and we will not develop one, so I am closing this bug. Amit, Markus, Is there any workaround, or advice that we can put in a tech-note? Thanks, Ronen.
Keep the host's paws off the physical CD-ROM. Does running the eject command in the guest work? RHEL-6 has trouble there: bug 729225.
Markus, Please write a tech note, and close this bug. Thanks, Ronen.
(In reply to comment #2) > Keep the host's paws off the physical CD-ROM. Does running the eject > command in the guest work? RHEL-6 has trouble there: bug 729225. try this test more than five times,every time the guest can eject host CDROM. 1.boot guest 2. (qemu) info block virtio0: type=hd removable=0 file=/home/rhel5.9-x86_64.qcow2 ro=0 drv=qcow2 encrypted=0 ide0-hd0: type=hd removable=0 file=/dev/cdrom ro=0 drv=host_device encrypted=0 ide1-cd0: type=cdrom removable=1 locked=0 [not inserted] floppy0: type=floppy removable=1 locked=0 [not inserted] sd0: type=floppy removable=1 locked=0 [not inserted] (qemu) change ide1-cd0 /dev/cdrom (qemu) info block virtio0: type=hd removable=0 file=/home/rhel5.9-x86_64.qcow2 ro=0 drv=qcow2 encrypted=0 ide0-hd0: type=hd removable=0 file=/dev/cdrom ro=0 drv=host_device encrypted=0 ide1-cd0: type=cdrom removable=1 locked=0 file=/dev/cdrom ro=1 drv=host_device encrypted=0 floppy0: type=floppy removable=1 locked=0 [not inserted] sd0: type=floppy removable=1 locked=0 [not inserted] 3)in guest #eject ------>host CDROM successfully eject 4)push host CDROM-->wait about 10 sec (qemu) info block virtio0: type=hd removable=0 file=/home/rhel5.9-x86_64.qcow2 ro=0 drv=qcow2 encrypted=0 ide0-hd0: type=hd removable=0 file=/dev/cdrom ro=0 drv=host_device encrypted=0 ide1-cd0: type=cdrom removable=1 locked=0 file=/dev/cdrom ro=1 drv=host_device encrypted=0 floppy0: type=floppy removable=1 locked=0 [not inserted] sd0: type=floppy removable=1 locked=0 [not inserted 5) repeat 4,5,about five times ,can successfully eject the host CDROM