Bug 539250 - Cannot eject cd-rom when configured to host cd-rom
Summary: Cannot eject cd-rom when configured to host cd-rom
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: kvm
Version: 5.4.z
Hardware: All
OS: Linux
low
low
Target Milestone: rc
: ---
Assignee: Eduardo Habkost
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks: 581789
TreeView+ depends on / blocked
 
Reported: 2009-11-19 18:17 UTC by James Ko
Modified: 2013-01-09 22:02 UTC (History)
8 users (show)

Fixed In Version: kvm-83-143.el5
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 581789 (view as bug list)
Environment:
Last Closed: 2010-03-30 07:55:55 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2010:0271 0 normal SHIPPED_LIVE Important: kvm security, bug fix and enhancement update 2010-03-29 13:19:48 UTC

Description James Ko 2009-11-19 18:17:40 UTC
Description of problem:
QEMU does not release cd-rom on 'eject ide1-cd0' when connected to the host's cd-rom drive /dev/scd0


Version-Release number of selected component (if applicable):
kvm-83-105.el5_4.9


How reproducible:
Everytime


Steps to Reproduce:
1. Connect the physical cd-rom drive to virtual cd-drive using 'change' commmand
2. Verify drive is connected with 'info block'
3. Attempt to release association the drive using 'eject' command
  
Actual results:
info block is still showing physical drive association

Expected results:
info block should show cd-rom device ide1-cd0 as [not inserted]


Additional info:
Unknown if it makes a difference but there is no physical disc present in the drive.  Will update once I can get test results with disc present.

Changing the cd-rom to another file without first ejecting successfully changes the drive in the guest.

Comment 1 Eduardo Habkost 2009-11-19 19:47:01 UTC
(In reply to comment #0)
> Additional info:
> Unknown if it makes a difference but there is no physical disc present in the
> drive.  Will update once I can get test results with disc present.

It does. For some reason, the eject code is conditional on bdrv_is_inserted(), that will return false if there is no physical disk inserted. I am investigating why it does that.

Comment 3 Eduardo Habkost 2009-11-30 21:13:44 UTC
Fix submitted upstream: http://marc.info/?l=qemu-devel&m=125961532916885

Comment 4 Andrius Benokraitis 2009-12-01 02:32:33 UTC
Removing Cisco from 'partner' field since this isn't a bugzilla being
requested/sponsored by the Cisco Engineering team via Red Hat Engineering
Partner Management.

Comment 10 Qunfang Zhang 2010-01-20 05:20:39 UTC
Can reproduce in kvm-83-142.el5.
Re-test in kvm-83-147.el5,this issue does not exist.

Steps:
1.boot a guest.(I tested win2k3 guest and rhel3.9 guest.)
/usr/libexec/qemu-kvm -no-hpet -usbdevice tablet -rtc-td-hack -m 2G -smp 2 -drive file=/root/win2k3-32-bak.raw,media=disk,if=ide -net nic,vlan=0,macaddr=10:1a:4a:10:20:4d,model=rtl8139 -net tap,vlan=0,script=/etc/qemu-ifup -cpu qemu64,+sse2 -boot c -monitor stdio -vnc :10
2.(qemu)info block
ide1-cd0: type=cdrom removable=1 locked=0 [not inserted]
3.(qemu)change ide1-cd0 /dev/cdrom
4.(qemu)info block
ide1-cd0: type=cdrom removable=1 locked=0 file=/dev/cdrom ro=0 drv=host_device
5.(qemu)eject ide1-cd0
(qemu)info block
ide1-cd0: type=cdrom removable=1 locked=0 file=/dev/cdrom ro=0 drv=host_device

Re-test with the same steps in kvm-83-147.el5.This issue does not exist.
4.(qemu)info block
ide1-cd0: type=cdrom removable=1 locked=0 file=/dev/cdrom ro=0 drv=host_device
5.(qemu)eject ide1-cd0
(qemu)info block
ide1-cd0: type=cdrom removable=1 locked=0 [not inserted]

This issue only happened when there is no physical disc present in the
drive.
I tested with the same steps when physical disc present.It works well.
And also I tested changing the cd-rom to an file(for example:rhle5.4-32.qcow2),it works well too.

Comment 13 errata-xmlrpc 2010-03-30 07:55:55 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2010-0271.html


Note You need to log in before you can comment on or make changes to this bug.