RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 729225 - eject command in the guest does not works properly when guest using host cdrom
Summary: eject command in the guest does not works properly when guest using host cdrom
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: qemu-kvm
Version: 6.2
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Amit Shah
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks: Rhel5KvmTier2
TreeView+ depends on / blocked
 
Reported: 2011-08-09 05:52 UTC by Mike Cao
Modified: 2013-01-10 00:12 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of: 709314
Environment:
Last Closed: 2012-08-01 07:39:48 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Mike Cao 2011-08-09 05:52:23 UTC
Reproduced on 
# uname -r
2.6.32-171.el6.x86_64
[root@localhost ~]# rpm -q qemu-kvm
qemu-kvm-0.12.1.2-2.177.el6.x86_64


+++ This bug was initially created as a clone of Bug #709314 +++

Description of problem:


Version-Release number of selected component (if applicable):
# uname -r
2.6.18-264.el5
# rpm -q kvm
kvm-83-235.el5


How reproducible:
100%

Steps to Reproduce:
1.start guest with /dev/sr0
eg:/usr/libexec/qemu-kvm -M rhel5.6.0 -m 2048 -smp 4,sockets=4,cores=1,threads=1 -name RHEL6u1 -uuid 7c9a4b2c-8d58-6771-7748-0ce92bfd83f7 -monitor stdio -no-kvm-pit-reinjection -boot dc -drive file=/dev/stress/rhel6u1,if=virtio,boot=on,format=raw,cache=none -drive file=/dev/sr0,if=ide,format=raw,cache=none,media=cdrom,bus=1,unit=0 -net nic,macaddr=54:52:00:7d:dd:37,vlan=0,model=virtio -net tap,vlan=0,downscript=no -serial pty -parallel none -usb -usbdevice tablet -vnc :2 -k en-us -vga cirrus -balloon none -notify all
2.change ide1-cd0 to make guest detect cd in the host cdrom.
(qemu)change ide1-cd0 /dev/sr0 (this step due to Bug 709304
3.mount /dev/sr0 in the guest .
#mount /dev/sr0 /opt
4,umount /dev/sr0  
#umount /dev/sr0
5.in the guest #eject
  
Actual results:
the tray open then closed immediately so that I could not get the cd out from host cdrom.
During this time ,qemu-kvm process freezed 

Expected results:
the tray keeps open.
qemu-kvm does not freeze

Additional info:

Comment 2 Amit Shah 2011-12-07 10:16:33 UTC
Host CDROM passthrough is difficult to get right due to multiple programs
involved that need fixing.

Comment 4 RHEL Program Management 2012-07-10 07:00:36 UTC
This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.

Comment 5 RHEL Program Management 2012-07-11 02:00:18 UTC
This request was erroneously removed from consideration in Red Hat Enterprise Linux 6.4, which is currently under development.  This request will be evaluated for inclusion in Red Hat Enterprise Linux 6.4.

Comment 6 Ronen Hod 2012-07-23 11:03:06 UTC
Please test the CD-ROM support using SCSI passthrough.
If it works, we prefer to close this bug.

Comment 7 Sibiao Luo 2012-07-24 08:37:19 UTC
(In reply to comment #6)
> Please test the CD-ROM support using SCSI passthrough.
> If it works, we prefer to close this bug.

Hi Ronen,

   I have tested the CD-ROM with SCSI passthrough, it can work correctly.

Steps:
1.boot a guest with a CD-ROM SCSI passthrough.
e.g. # /usr/libexec/qemu-kvm -M rhel6.3.0 -enable-kvm -m 2048 -smp 2,sockets=1,cores=2,threads=1 -m 2G -usb -device usb-tablet,id=input0 -name sluo-test -drive file=/home/rhel6.3.5.31.0.qcow2,if=none,id=drive-virtio-disk-0,format=qcow2,cache=none,werror=stop,rerror=stop -device virtio-blk-pci,drive=drive-virtio-disk-0,id=virtio0,bootindex=1 -netdev tap,script=/etc/qemu-ifup,id=netdev0 -device virtio-net-pci,netdev=netdev0,id=device-net0 -spice port=5931,disable-ticketing -vga qxl -monitor stdio -boot menu=on -nodefconfig -nodefaults -drive file=/dev/sr0,if=none,media=cdrom,id=drive-scsi-sluo,format=raw,cache=none,werror=stop,rerror=stop -device virtio-scsi-pci,id=scsi -device scsi-block,drive=drive-scsi-sluo,id=scsi_sluo
2.# ls -l /dev/cdrom1 
  lrwxrwxrwx. 1 root root 3 Jul 23 19:39 /dev/cdrom1 -> sr0
  # ls -l /dev/sr0 
  brw-rw----+ 1 root cdrom 11, 0 Jul 23 19:39 /dev/sr0
3.repeat popup and drop-in the CD-ROM SCSI passthrough device for 100 times.
# eject /dev/sr0 
# eject -t /dev/sr0

Result:
after the step 3, the CD-ROM SCSI passthrough device can be popup and drop-in successfully.

BTW, if i popup the CD-ROM SCSI passthrough device via 'eject -r /dev/sr0', it always fail to popup and prompt some 'Input/output error'. But if i use 'eject -s /dev/sr0' or 'eject /dev/sr0', it can popup the CD-ROM SCSI passthrough device correctly. I also try this test scenario on my host, they all work correctly. Maybe there a bug for SCSI passthrough, would i file a bug to track this issue.
# eject -r /dev/sr0 
eject: unable to eject, last error: Input/output error

Best wish & thx.
sluo

Comment 8 Amit Shah 2012-08-01 07:39:48 UTC
Please create a separate bug for other behaviour.  For this IDE one, I'll close it.

Comment 9 Sibiao Luo 2012-08-14 15:00:27 UTC
(In reply to comment #8)
> Please create a separate bug for other behaviour.  For this IDE one, I'll
> close it.

hi amit,

   I have separated it in bz #842946, but paol close it to NOTABUG, could you help check it.

Thanks.
sluo


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