Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 886878 - atapi: tray statuses (locked and open) are not reset on boot/reboot of guest
atapi: tray statuses (locked and open) are not reset on boot/reboot of guest
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: qemu-kvm (Show other bugs)
6.4
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: Pavel Hrdina
Virtualization Bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-12-13 08:12 EST by Pavel Hrdina
Modified: 2013-11-21 00:59 EST (History)
11 users (show)

See Also:
Fixed In Version: qemu-kvm-0.12.1.2-2.373.el6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-11-21 00:59:08 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2013:1553 normal SHIPPED_LIVE Important: qemu-kvm security, bug fix, and enhancement update 2013-11-20 16:40:29 EST

  None (edit)
Description Pavel Hrdina 2012-12-13 08:12:20 EST
Description of problem:

If you reboot a guest which locks the tray of optical drive the optical drive stay locked.

How reproducible: 100%


Steps to Reproduce:
1. Boot a guest with media inserted in optical drive (for example fedora 17)
2. The media is auto-mounted and the optical drive is locked
3. Reboot the guest.
4. Before kernel is loaded (in GRUB time) the optical drive is locked
  
Actual results:
Before kernel is loaded the optical drive is locked.


Expected results:
Optical drive should not be locked.
Comment 8 langfang 2013-06-26 02:59:26 EDT
Reproduce this bug as follow version:
Host:
# uname -r
2.6.32-392.el6.x86_64
# rpm -q qemu-kvm
qemu-kvm-0.12.1.2-2.356.el6.x86_64

Guest:
2.6.32-358.el6.x86_64

Steps:
1.Boot guest with
...
-drive file=/home/RHEL6.4-20130123.0-Server-x86_64-DVD1.iso,if=none,media=cdrom,id=cdrom,readonly=on,format=raw -device ide-drive,bus=ide.1,unit=0,drive=cdrom,id=cdrom,id=cdrom...

2.After guest boot up,check the cdrom have mounted /dev/sr0. 
(qemu) info block
drive-virtio-disk1: removable=0 io-status=ok file=/home/RHEL-Server-6.4-64-virtio.qcow2 ro=0 drv=qcow2 encrypted=0
cdrom: removable=1 locked=1 tray-open=0 io-status=ok file=/home/RHEL6.4-20130123.0-Server-x86_64-DVD1.iso ro=1 drv=raw encrypted=0
floppy0: removable=1 locked=0 tray-open=0 [not inserted]
sd0: removable=1 locked=0 tray-open=0 [not inserted]

3.Reboot guest 
(qemu)system_reset
4.Check the locked value of cdrom
(qemu)info block
drive-virtio-disk1: removable=0 io-status=ok file=/home/RHEL-Server-6.4-64-virtio.qcow2 ro=0 drv=qcow2 encrypted=0
cdrom: removable=1 locked=1 tray-open=0 io-status=ok file=/home/RHEL6.4-20130123.0-Server-x86_64-DVD1.iso ro=1 drv=raw encrypted=0
floppy0: removable=1 locked=0 tray-open=0 [not inserted]
sd0: removable=1 locked=0 tray-open=0 [not inserted]

Results:
After step 4,before guest kernel is loaded the optical drive is locked.

Verify this bug as follow version:
HOst:
# uname -r
2.6.32-392.el6.x86_64
# rpm -q qemu-kvm
qemu-kvm-0.12.1.2-2.376.el6.x86_64

Guest:
2.6.32-358.el6.x86_64

The steps as same as reproduce

Results:
While guest begin reboot, the locked value of cdrom changed to 0

cdrom: removable=1 locked=0 tray-open=0 io-status=ok file=/home/RHEL6.4-20130123.0-Server-x86_64-DVD1.iso ro=1 drv=raw encrypted=0

Addtional info:
1)If only boot guest ,the "locked value" is 0.
2)I aslo tried passthrough a cdrom wich ide-drive, the steps as same as reproduce, after reboot guest,the value changed to 0
...-drive file=/dev/sr0,if=none,media=cdrom,id=cdrom,readonly=on,format=raw -device ide-drive,bus=ide.1,unit=0,drive=cdrom,id=cdrom,id=cdrom,
3)Also tried use local cdrom with scsi-cd,work well

My CLI: /usr/libexec/qemu-kvm -monitor stdio  -chardev socket,id=serial_id_20120515-041452-KkUY,path=/tmp/serial-20120515-041452-KkUY,server,nowait -device isa-serial,chardev=serial_id_20120515-041452-KkUY -device ich9-usb-uhci1,id=usb1,bus=pci.0,addr=0x4 -drive file=/home/RHEL-Server-6.4-64-virtio.qcow2,index=0,if=none,id=drive-virtio-disk1,media=disk,cache=none,boot=on,snapshot=off,readonly=off,format=qcow2,aio=native -device virtio-blk-pci,bus=pci.0,addr=0x5,drive=drive-virtio-disk1,id=virtio-disk1 -device virtio-net-pci,netdev=idLYjg29,mac=9a:6e:47:a6:d8:f9,id=ndev00idLYjg29,bus=pci.0,addr=0x3 -netdev tap,id=idLYjg29,vhost=on -m 2048 -smp 4,cores=2,threads=1,sockets=2 -cpu Penryn  -device usb-tablet,id=usb-tablet1,bus=usb1.0 -spice port=8000,disable-ticketing -vga qxl -rtc base=utc,clock=host,driftfix=slew -M rhel6.4.0 -boot order=cdn,once=c,menu=off    -no-kvm-pit-reinjection -enable-kvm -monitor unix:/tmp/monitor-unix,nowait,server -serial unix:/tmp/tty0,server,nowait -drive file=/home/RHEL6.4-20130123.0-Server-x86_64-DVD1.iso,if=none,id=drive-disk,format=raw,cache=none,aio=native,werror=stop,rerror=stop -device virtio-scsi-pci,id=scsi1,addr=0x8,bus=pci.0 -device scsi-cd,bus=scsi1.0,drive=drive-disk,id=cd-disk


According to above test ,this bug fixed.
Comment 11 langfang 2013-06-27 23:08:44 EDT
Addtional info for comment8.

On the verify version.
HOst:
# uname -r
2.6.32-392.el6.x86_64
# rpm -q qemu-kvm
qemu-kvm-0.12.1.2-2.376.el6.x86_64

Guest:
2.6.32-358.el6.x86_64

Results:

 While guest begin reboot, the locked value of cdrom changed to 0--->after guest boot up , the value automatically changed to 1 .
Comment 12 Qunfang Zhang 2013-06-27 23:34:05 EDT
(In reply to langfang from comment #11)
> Addtional info for comment8.
> 
> On the verify version.
> HOst:
> # uname -r
> 2.6.32-392.el6.x86_64
> # rpm -q qemu-kvm
> qemu-kvm-0.12.1.2-2.376.el6.x86_64
> 
> Guest:
> 2.6.32-358.el6.x86_64
> 
> Results:
> 
>  While guest begin reboot, the locked value of cdrom changed to 0--->after
> guest boot up , the value automatically changed to 1 .

I think flang means when the cdrom is mounted automatically by the guest os, the "lock" flag changes to 1. Right?
Comment 13 langfang 2013-06-27 23:47:12 EDT
(In reply to Qunfang Zhang from comment #12)
> (In reply to langfang from comment #11)
> > Addtional info for comment8.
> > 
> > On the verify version.
> > HOst:
> > # uname -r
> > 2.6.32-392.el6.x86_64
> > # rpm -q qemu-kvm
> > qemu-kvm-0.12.1.2-2.376.el6.x86_64
> > 
> > Guest:
> > 2.6.32-358.el6.x86_64
> > 
> > Results:
> > 
> >  While guest begin reboot, the locked value of cdrom changed to 0--->after
> > guest boot up , the value automatically changed to 1 .
> 
> I think flang means when the cdrom is mounted automatically by the guest os,
> the "lock" flag changes to 1. Right?

 qzhang, yes .
Comment 15 errata-xmlrpc 2013-11-21 00:59:08 EST
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/RHSA-2013-1553.html

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