Bug 1021101

Summary: [virt] some CD-ROMs are hidden if the drives are attached to separate controllers
Product: Red Hat Enterprise Linux 7 Reporter: Sibiao Luo <sluo>
Component: systemdAssignee: systemd-maint
Status: CLOSED NOTABUG QA Contact: qe-baseos-daemons
Severity: medium Docs Contact:
Priority: medium    
Version: 7.0CC: acathrow, harald, juli, juzhang, michen, pbonzini, sluo, systemd-maint-list, virt-maint, xfu
Target Milestone: rcFlags: harald: needinfo-
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-11-11 11:41:09 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:

Description Sibiao Luo 2013-10-19 12:03:49 UTC
Description of problem:
boot guest with attaching multi CD-ROMs to guest with IDE or SCSI-CD interface, the seabios can list the multi cdroms in device list correctly, but only one cdrom can be detected in guest. BTW, both the PC and Q35 machine type can hit this issue.

Version-Release number of selected component (if applicable):
host info:
3.10.0-34.el7.x86_64
qemu-kvm-1.5.3-9.el7.x86_64
seabios-bin-1.7.2.2-2.el7.noarch
guest info:
3.10.0-34.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1.boot guest with attaching multi CD-ROMs to guest with SCSI-CD interface.
e.g1:...-drive file=/home/cdrom1.iso,if=none,id=cd-rom1,media=cdrom,format=raw,readonly=on -device virtio-scsi-pci,id=sluo1 -device scsi-cd,drive=cd-rom1,id=cd1,bus=sluo1.0 -drive file=/home/cdrom2.iso,if=none,id=cd-rom2,media=cdrom,format=raw,readonly=on -device virtio-scsi-pci,id=sluo2 -device scsi-cd,bus=sluo2.0,drive=cd-rom2,id=cd2
(qemu) info block
drive-virtio-disk: removable=0 io-status=ok file=/home/RHEL-Server-7.0-64.qcow2 ro=0 drv=qcow2 encrypted=0 bps=0 bps_rd=0 bps_wr=0 iops=0 iops_rd=0 iops_wr=0
cd-rom1: removable=1 locked=1 tray-open=0 io-status=ok file=/home/cdrom1.iso ro=1 drv=raw encrypted=0 bps=0 bps_rd=0 bps_wr=0 iops=0 iops_rd=0 iops_wr=0
cd-rom2: removable=1 locked=1 tray-open=0 io-status=ok file=/home/cdrom2.iso ro=1 drv=raw encrypted=0 bps=0 bps_rd=0 bps_wr=0 iops=0 iops_rd=0 iops_wr=0
floppy0: removable=1 locked=0 tray-open=0 [not inserted]
sd0: removable=1 locked=0 tray-open=0 [not inserted]
2.check the cdroms in guest.
# ls -lh /dev/cdrom*
3.boot guest with attaching multi CD-ROMs to guest with IDE interface.
e.g2:...-drive file=/home/cdrom1.iso,if=none,id=cd-rom1,media=cdrom,format=raw,readonly=on -device ide-drive,bus=ide.0,unit=0,drive=cd-rom1,id=cd1 -drive file=/home/cdrom2.iso,if=none,id=cd-rom2,media=cdrom,format=raw,readonly=on -device ide-drive,bus=ide.0,unit=1,drive=cd-rom2,id=cd2
(qemu) info block
drive-virtio-disk: removable=0 io-status=ok file=/home/RHEL-Server-7.0-64.qcow2 ro=0 drv=qcow2 encrypted=0 bps=0 bps_rd=0 bps_wr=0 iops=0 iops_rd=0 iops_wr=0
cd-rom1: removable=1 locked=0 tray-open=0 io-status=ok file=/home/cdrom1.iso ro=1 drv=raw encrypted=0 bps=0 bps_rd=0 bps_wr=0 iops=0 iops_rd=0 iops_wr=0
cd-rom2: removable=1 locked=0 tray-open=0 io-status=ok file=/home/cdrom2.iso ro=1 drv=raw encrypted=0 bps=0 bps_rd=0 bps_wr=0 iops=0 iops_rd=0 iops_wr=0
floppy0: removable=1 locked=0 tray-open=0 [not inserted]
sd0: removable=1 locked=0 tray-open=0 [not inserted]
4.check the cdroms in guest.
# ls -lh /dev/cdrom*

Actual results:
after step 2, only one cdrom can be detected in guest, like:
# ls -lh /dev/cdrom*
lrwxrwxrwx. 1 root root 3 Oct 19 14:16 /dev/cdrom -> sr0
after step 4, only one cdrom can be detected in guest, like:
# ls -lh /dev/cdrom*
lrwxrwxrwx. 1 root root 3 Oct 20 3:54 /dev/cdrom -> sr0

Expected results:
after step 2, if use the scsi-cd interface, the muti-cdroms should be detected in guest correctly. About the default IDE cdrom device  disappear when attach a emulated SCSI cdrom(scsi-cd), please refer to bug 974910.
# ls -lh /dev/cdrom*
lrwxrwxrwx. 1 root root 3 Oct 20 03:17 /dev/cdrom -> sr0  <--------bug 974910 
lrwxrwxrwx. 1 root root 3 Oct 20 03:17 /dev/cdrom1 -> sr2
lrwxrwxrwx. 1 root root 3 Oct 20 03:17 /dev/cdrom2 -> sr1

after step 4, if use the ide interface, it should be like:
# ls -lh /dev/cdrom*
lrwxrwxrwx. 1 root root 3 Oct 20 02:09 /dev/cdrom1 -> sr0
lrwxrwxrwx. 1 root root 3 Oct 20 02:09 /dev/cdrom2 -> sr1

Additional info:

Comment 1 Paolo Bonzini 2013-10-24 22:58:57 UTC
Please try again with a RHEL6 guest.  I cannot reproduce it with

kernel-2.6.32-258.el6.x86_64
udev-147-2.35.el6.x86-64

If it works, please reassign to systemd.  Also please test with a single virtio-scsi-pci controller and both disks attached to that controller.

Comment 2 Sibiao Luo 2013-10-25 02:20:42 UTC
(In reply to Paolo Bonzini from comment #1)
> Please try again with a RHEL6 guest.  I cannot reproduce it with
> 
> kernel-2.6.32-258.el6.x86_64
> udev-147-2.35.el6.x86-64
Yes, if use rhel6.5 guest that did not hit it.
host info:
# uname -r && rpm -q qemu-kvm
2.6.32-424.el6.x86_64
qemu-kvm-0.12.1.2-2.414.el6.x86_64
guest info:
kernel-2.6.32-424.el6.x86_64
udev-147-2.50.el6.x86-64
e.g:...-drive file=/home/cdrom1.iso,if=none,id=cd-rom1,media=cdrom,format=raw,readonly=on -device virtio-scsi-pci,id=sluo1 -device scsi-cd,drive=cd-rom1,id=cd1,bus=sluo1.0 -drive file=/home/cdrom2.iso,if=none,id=cd-rom2,media=cdrom,format=raw,readonly=on -device virtio-scsi-pci,id=sluo2 -device scsi-cd,bus=sluo2.0,drive=cd-rom2,id=cd2
# ls -lh /dev/cdrom*
lrwxrwxrwx. 1 root root 3 Oct 24 22:09 /dev/cdrom1 -> sr0
lrwxrwxrwx. 1 root root 3 Oct 24 22:09 /dev/cdrom2 -> sr1
e.2:...-drive file=/home/cdrom1.iso,if=none,id=cd-rom1,media=cdrom,format=raw,readonly=on -device ide-drive,bus=ide.0,unit=0,drive=cd-rom1,id=cd1 -drive file=/home/cdrom2.iso,if=none,id=cd-rom2,media=cdrom,format=raw,readonly=on -device ide-drive,bus=ide.0,unit=1,drive=cd-rom2,id=cd2
# ls -lh /dev/cdrom*
lrwxrwxrwx. 1 root root 3 Oct 24 22:15 /dev/cdrom5 -> sr0
lrwxrwxrwx. 1 root root 3 Oct 24 22:15 /dev/cdrom6 -> sr1
> If it works, please reassign to systemd.  Also please test with a single
> virtio-scsi-pci controller and both disks attached to that controller.
If use single virtio-scsi-pci controller attached two cd-rom via scsi-cd wiht rhel6.5 guest that also did not meet such issue.

Best Regards,
sluo

Comment 3 Harald Hoyer 2013-11-11 11:41:09 UTC
Current udev does not provide cdrom[0-9] symbolic links anymore.

Comment 4 Paolo Bonzini 2013-11-11 13:23:18 UTC
Harald, please make sure that there is documentation about this (Release Notes?).