Bug 803219

Summary: virtio-scsi:after eject virtio-scsi CD-ROM tray-open's value still be 0
Product: Red Hat Enterprise Linux 6 Reporter: daiwei <wdai>
Component: qemu-kvmAssignee: Paolo Bonzini <pbonzini>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: low Docs Contact:
Priority: low    
Version: 6.3CC: acathrow, bsarathy, flang, juzhang, michen, minovotn, mkenneth, pbonzini, shuang, tburke, virt-maint
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: qemu-kvm-0.12.1.2-2.263.el6 Doc Type: Bug Fix
Doc Text:
No documentation needed
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-06-20 11:44:49 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 769712, 857935, 889075    

Description daiwei 2012-03-14 08:57:30 UTC
Description of problem:

Boot guest with a virtio-scsi CD-ROM,then eject CD-ROM in guest system.Check tray status in qemu monitor,tray-open's value still be 0.When tray is open,tray-open's value should be 1.

Version-Release number of selected component (if applicable):
# uname -r;rpm -q qemu-kvm
2.6.32-250.el6.x86_64
qemu-kvm-0.12.1.2-2.241.el6.x86_64

How reproducible:
100%

Steps to Reproduce:
1.Boot guest with emulated virtio-scsi CD-ROM

/usr/libexec/qemu-kvm -M rhel6.3.0 -enable-kvm -name RHEL-Server-6.3-64 -smp 2 -m 4G -uuid 4bbfae8f-0d08-41ad-926a-c7a7568d50f7 -boot menu=on -drive file=/home/rhel6.3-64.raw,if=none,id=drive-virtio-disk0,format=raw,cache=none,media=disk,werror=stop,rerror=stop -device virtio-scsi-pci,id=virtio-blk-pci0,bus=pci.0,addr=0x5 -device scsi-hd,drive=drive-virtio-disk0,logical_block_size=512,physical_block_size=512,scsi-id=0,lun=0,bootindex=1 -netdev tap,id=hostnet0,vhost=on,script=/etc/qemu-ifup -device virtio-net-pci,netdev=hostnet0,id=net0,mac=44:37:E6:5E:A3:F2,bus=pci.0,addr=0x4,id=net0 -vnc :1 -vga std -balloon none -monitor stdio -usb -usbdevice tablet -drive file=/home/RHEL6.3-20120304.n.0-Server-x86_64-DVD1.iso,if=none,id=cdrom1 -device virtio-scsi-pci,id=cdrom -device scsi-cd,drive=cdrom1,scsi-id=0,lun=0 -nodefconfig -nodefaults

2.Check CD-ROM status in qemu monitor

3.eject CD-ROM in guest system

#eject /dev/sr0

4.Check CD-ROM status in qemu monitor again
  
Actual results:

After step 4, tray-open's value still be 0 

Expected results:

 tray-open's value should change to 1.


Additional info:

Passthrough virtio-scsi CD-ROM also has this issue.

Comment 2 Paolo Bonzini 2012-03-16 12:28:13 UTC
Passthrough virtio-scsi CD-ROM is not able to sense the tray state.  Looking into it for scsi-cd CD-ROM.

Comment 3 Paolo Bonzini 2012-03-16 16:50:40 UTC
This is due to autoclose.  It works if you do "echo 0 > /proc/sys/dev/cdrom/autoclose".  Leaving it open to investigate how it works on real CDs, but since "change" works I'm lowering the priority.

Comment 7 langfang 2012-04-06 06:46:02 UTC
verify this issue with two senario

senaro 1)
version:
# uname -r
2.6.32-257.el6.x86_64
# rpm -q qemu-kvm
qemu-kvm-0.12.1.2-2.262.el6.x86_64
senario 2)
version:
# uname -r
2.6.32-257.el6.x86_64
# rpm -q qemu-kvm
qemu-kvm-0.12.1.2-2.265.el6.x86_64
steps:
1.boot a guest
/usr/libexec/qemu-kvm -m 2G -smp 1 -cpu Penryn,+x2apic, -usbdevice tablet -drive file=/mnt/RHEL-Server-6.3-64-virtio.qcow2-newinstall5,format=qcow2,if=none,id=drive-ide0-0-0,werror=stop,rerror=stop,cache=none -device virtio-blk-pci,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=2 -netdev tap,id=hostnet0,script=/etc/qemu-ifup -device virtio-net-pci,netdev=hostnet0,mac=00:10:20:2d:31:21,bus=pci.0,addr=0x4,id=net0 -boot order=cdn,once=n,menu=on -uuid 3290efd3-7c9e-44f9-b5f7-af0f3a1b3066 -rtc base=utc,clock=host,driftfix=slew -no-kvm-pit-reinjection -monitor stdio -name rhel6.1 -spice port=1000,disable-ticketing -vga qxl -device virtio-balloon-pci,bus=pci.0,id=balloon0 -device usb-ehci,id=ehci -drive file=/mnt/RHEL6.3-20120313.2-Server-x86_64-DVD1.iso,if=none,id=cdrom1 -device virtio-scsi-pci,id=cdrom -device scsi-cd,drive=cdrom1,scsi-id=0,lun=0 -nodefconfig -nodefaults 

2.Check CD-ROM status in qemu monitor
(qemu) info block
drive-ide0-0-0: removable=0 io-status=ok file=/mnt/RHEL-Server-6.3-64-virtio.qcow2-newinstall5 ro=0 drv=qcow2 encrypted=0
cdrom1: removable=1 locked=0 tray-open=0 io-status=ok file=/mnt/RHEL6.3-20120313.2-Server-x86_64-DVD1.iso ro=0 drv=raw encrypted=0
3.echo 0 >
/proc/sys/dev/cdrom/autoclose  in guest
4.eject CD-ROM in guest system

#eject /dev/sr0

5.Check CD-ROM status in qemu monitor again
(qemu)info block

drive-ide0-0-0: removable=0 io-status=ok file=/mnt/RHEL-Server-6.3-64-virtio.qcow2-newinstall5 ro=0 drv=qcow2 encrypted=0
cdrom1: removable=1 locked=0 tray-open=1 io-status=ok file=/mnt/RHEL6.3-20120313.2-Server-x86_64-DVD1.iso ro=0 drv=raw encrypted=0


so,the stray-open value can be change when eject cdrom.

Comment 10 Michal Novotny 2012-05-04 13:09:20 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
NEEDINFO

Comment 11 Paolo Bonzini 2012-05-04 13:44:36 UTC
New feature in 6.3, no documentation needed.

Comment 12 Paolo Bonzini 2012-05-04 13:44:36 UTC
    Technical note updated. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    Diffed Contents:
@@ -1 +1 @@
-NEEDINFO+No documentation needed

Comment 13 errata-xmlrpc 2012-06-20 11:44:49 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2012-0746.html