Bug 993777

Summary: Passthrough CDROM(scsi_block) can not be removable
Product: Red Hat Enterprise Linux 6 Reporter: langfang <flang>
Component: qemu-kvmAssignee: Virtualization Maintenance <virt-maint>
Status: CLOSED NOTABUG QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: low    
Version: 6.5CC: acathrow, bsarathy, flang, juzhang, mkenneth, qzhang, sluo, virt-maint
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-08-07 03:17:27 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description langfang 2013-08-06 12:12:53 UTC
Description of problem:
Passthrough CDROM(scsi_block) can not be removable

Version-Release number of selected component (if applicable):
Host:
# uname -r
2.6.32-405.el6.x86_64
# rpm -q qemu-kvm
qemu-kvm-0.12.1.2-2.382.el6.x86_64
# rpm -q seabios
seabios-0.6.1.2-28.el6.x86_64

Guest:rhel6.5
2.6.32-403.el6.x86_64

How reproducible:

100%

Steps to Reproduce:
1.Boot guest
...-drive file=/dev/cdrom,if=none,id=drive-cd-disk,media=cdrom,format=raw,cache=none,werror=stop,rerror=stop -device virtio-scsi-pci,bus=pci.0,addr=0x7,id=scsi1 -device scsi-block,drive=drive-cd-disk,bus=scsi1.0,id=scsi_cd...

2.(qemu)info block
(qemu) info block
drive-scsi0-0-0: removable=0 io-status=ok file=/home/RHEL-Server-6.4-64-virtio.qcow2 ro=0 drv=qcow2 encrypted=0 bps=0 bps_rd=0 bps_wr=0 iops=0 iops_rd=0 iops_wr=0
drive-cd-disk: removable=0 io-status=ok file=/dev/cdrom ro=1 drv=raw encrypted=0 bps=0 bps_rd=0 bps_wr=0 iops=0 iops_rd=0 iops_wr=0--->removable=0
ide1-cd0: removable=1 locked=0 tray-open=0 io-status=ok [not inserted]
floppy0: removable=1 locked=0 tray-open=0 [not inserted]
sd0: removable=1 locked=0 tray-open=0 [not inserted]

3.Tried to change the disk
(qemu)change drive-cd-disk /home//Windows_Server_2008_R2_GA_EN.iso
Device 'drive-cd-disk' is not removable

Actual results:
Can't change the passthrough CDROM

Expected results:
Can change the passthrough CDROM

Additional info:
1)If I boot guest with "scsi-cd",not hit the problem
...-drive file=/dev/cdrom,if=none,id=drive-cd-disk,media=cdrom,format=raw,cache=none,werror=stop,rerror=stop -device virtio-scsi-pci,bus=pci.0,addr=0x7,id=scsi1 -device scsi-cd,drive=drive-cd-disk,bus=scsi1.0,id=scsi_cd..
(qemu)info block
...
drive-cd-disk: removable=1 io-status=ok file=/dev/cdrom ro=1 drv=raw encrypted=0 bps=0 bps_rd=0 bps_wr=0 iops=0 iops_rd=0 iops_wr=0--->removable=1
2)Same problem not found on rhel7 host(rhel6.5 guest)
will see:
drive-cd-disk: removable=1 io-status=ok file=/dev/cdrom ro=1 drv=raw encrypted=0 bps=0 bps_rd=0 bps_wr=0 iops=0 iops_rd=0 iops_wr=0--->removable=1

3)eject the CDROM in guest ,can be eject succsessfully--->then (qemu)drive-cd-disk /home//Windows_Server_2008_R2_GA_EN.iso--->hit same problem(can not change)

Choose the CDROM in guest--->choose "eject"

4)MY CLI:/usr/libexec/qemu-kvm -M rhel6.5.0 -m 4G -smp 4 -device virtio-scsi-pci,bus=pci.0,addr=0x5,id=scsi0 -drive file=/home/RHEL-Server-6.4-64-virtio.qcow2,if=none,id=drive-scsi0-0-0,media=disk,cache=none,format=qcow2,werror=stop,rerror=stop,aio=native -device scsi-hd,drive=drive-scsi0-0-0,bus=scsi0.0,scsi-id=0,lun=0,id=flang,bootindex=1 -spice port=5830,disable-ticketing -vga qxl -qmp tcp:0:5555,server,nowait -global PIIX4_PM.disable_s3=0 -global PIIX4_PM.disable_s4=0 -serial unix:/tmp/tty1,server,nowait  -boot menu=on -monitor stdio -drive file=/dev/cdrom,if=none,id=drive-cd-disk,media=cdrom,format=raw,cache=none,werror=stop,rerror=stop -device virtio-scsi-pci,bus=pci.0,addr=0x7,id=scsi1 -device scsi-block,drive=drive-cd-disk,bus=scsi1.0,id=scsi_cd

Comment 1 langfang 2013-08-06 12:20:22 UTC
correct info:

3)eject the CDROM in guest ,can be eject succsessfully--->then (qemu)change drive-cd-disk /home//Windows_Server_2008_R2_GA_EN.iso--->hit same problem(can not change)
Choose the CDROM in guest--->choose "eject"

Comment 3 langfang 2013-08-07 02:34:46 UTC
Test this bug on latest verion on rhel7,hit same problem
# uname -r 
3.10.0-4.el7.x86_64
# rpm -q qemu-kvm
qemu-kvm-1.5.2-2.el7.x86_64

Guest:
2.6.32-397.el6.x86_64

1.Boot guest with
... -drive file=/dev/cdrom,if=none,id=drive-cd-disk,media=cdrom,format=raw,cache=none,werror=stop,rerror=stop -device virtio-scsi-pci,bus=pci.0,addr=0x7,id=scsi1 -device scsi-block,drive=drive-cd-disk,bus=scsi1.0,id=scsi_cd..

2.(qemu)info block
...
drive-cd-disk: removable=0 io-status=ok file=/dev/cdrom ro=1 drv=raw encrypted=0 bps=0 bps_rd=0 bps_wr=0 iops=0 iops_rd=0 iops_wr=0--->removable=0
..
3.
(qemu) change drive-cd-disk /home/Windows_Server_2008_R2_GA_EN.iso 
Device 'drive-cd-disk' is not removable

4.eject in rhel6.5 guest
Choose the CDROM device--->press "eject"-->successfully

5)(qemu)info block
..drive-cd-disk: removable=0 io-status=ok file=/dev/cdrom ro=1 drv=raw encrypted=0 bps=0 bps_rd=0 bps_wr=0 iops=0 iops_rd=0 iops_wr=0..

6)(qemu)change drive-cd-disk /home/Windows_Server_2008_R2_GA_EN.iso 
Device 'drive-cd-disk' is not removable


addtional info:
1)If use "scsi-cd" not hit the problem
...
-drive file=/dev/cdrom,if=none,id=drive-cd-disk,media=cdrom,format=raw,cache=none,werror=stop,rerror=stop -device virtio-scsi-pci,bus=pci.0,addr=0x7,id=scsi1 -device scsi-cd,drive=drive-cd-disk,bus=scsi1.0,id=scsi_cd...

(qemu)info block
..
drive-cd-disk: removable=1 locked=0 tray-open=0 io-status=ok file=/dev/cdrom ro=1 drv=raw encrypted=0 bps=0 bps_rd=0 bps_wr=0 iops=0 iops_rd=0 iops_wr=0--->removable=1
..

My idea:
1) Maybe this is the design for scsi-block(passthrough cdrom)

2)I see another bug 

Bug 687900 - qemu host cdrom support not properly updating guests on media changes at physical CD/DVD drives--->won't fix

As Amit comment40 :

"Closing this bug -- please see comment 35, comment 36.  scsi cdrom passthrough can give better results, but cdrom passthrough on RHEL6 hosts isn't currently being worked on."

So maybe this is won't fix problem.

Hi, amit 

    Could you pleases help me see this bug?

thanks

Comment 4 langfang 2013-08-07 03:17:27 UTC
I will close this bug ,because when we want to change the passthrough CDROM,no need to  use qemu commands to change ,eg:(qemu)change drive-cd-disk /home/Windows_Server_2008_R2_GA_EN.iso .We should change the passthrogh CDROM through physical machine CDROM drive. And i also test ,not hit problem.


thanks