Bug 839817

Summary: can't mount SCSI CD-ROM using its LABEL under KVM/qemu
Product: [Fedora] Fedora Reporter: Cristian Ciupitu <cristian.ciupitu>
Component: qemuAssignee: Paolo Bonzini <pbonzini>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 19CC: amit.shah, berrange, cfergeau, crobinso, dwmw2, harald, itamar, johannbg, jonathan, knoel, lnykryn, metherid, mschmidt, msekleta, notting, pbonzini, plautrba, rjones, scottt.tw, systemd-maint, udev-maint, virt-maint
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 857124 (view as bug list) Environment:
Last Closed: 2013-07-11 16:04:22 EDT Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Bug Depends On:    
Bug Blocks: 857124    
Attachments:
Description Flags
/var/log/messages
none
dmesg
none
systemctl dump
none
udevadm info -q all -n /dev/sr0
none
/usr/lib/udev/cdrom_id --debug /dev/sr0 none

Description Cristian Ciupitu 2012-07-12 19:25:19 EDT
Created attachment 597917 [details]
/var/log/messages

Description of problem: 
I have a KVM/qemu virtual machine with a SCSI CD-ROM which can't be
mounted at boot time even if it's possible afterwards. If I replace the
SCSI CD-ROM with an IDE CD-ROM, it works fine.

Version-Release number of selected component (if applicable):
(on the guest)
systemd-44-17.fc17.i686
udev-182-3.fc17.i686
kernel-PAE-3.3.4-5.fc17.i686
(on the host)
libvirt-0.9.11.4-3.fc17.x86_64.rpm
libvirt-daemon-kvm-0.9.11.4-3.fc17.x86_64.rpm
qemu-kvm-1.0-17.fc17.x86_64.rpm

How reproducible:
Every time

Steps to Reproduce:
1. Create a KVM/qemu virtual machine with a SCSI CD-ROM.
2. Connect an ISO images to it.
3. Edit /etc/fstab to mount it based on its LABEL, e.g.:
    LABEL="Fedora\04017\040i386" /mnt/Fedora iso9660 ro 0 0
4. Reboot
  
Actual results:
systemd will complain that the mounting of the CD-ROM failed

Expected results:
The machine should mount the CD-ROM and boot without any errors.

Additional info:
There is no /dev/disk/by-label directory after entering the root
password to enter into maintenance mode. However the by-id, by-path and
by-uuid directories exist. `mount /mnt/...` will work.

/proc/cmdline:
BOOT_IMAGE=/vmlinuz-3.4.4-5.fc17.i686.PAE root=UUID=05bb3baa-1eae-4d5e-aa4d-7145b538f900 ro rd.md=0 rd.lvm=0 rd.dm=0 SYSFONT=True KEYTABLE=us rd.luks=0 LANG=en_US.UTF-8 ipv6.disable=1 systemd.log_level=debug systemd.log_target=kmsg log_buf_len=1M

The output of `/usr/bin/systemd --test --system --log-level=debug` was
empty.


`virsh dumpxml` of the SCSI CD-ROMs:
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw' cache='none'/>
      <source file='/mnt/.../Fedora-17-i386-DVD.iso'>
        <seclabel relabel='yes'/>
      </source>
      <target dev='sda' bus='scsi'/>
      <readonly/>
      <shareable/>
      <alias name='scsi0-0-0'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>

`virsh dumpxml` of the IDE CD-ROM:
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw' cache='none'/>
      <source file='/mnt/.../Fedora-17-i386-DVD.iso'>
        <seclabel relabel='yes'/>
      </source>
      <target dev='hdc' bus='ide'/>
      <readonly/>
      <shareable/>
      <alias name='ide0-1-0'/>
      <address type='drive' controller='0' bus='1' target='0' unit='0'/>
    </disk>
Comment 1 Cristian Ciupitu 2012-07-12 19:26:19 EDT
Created attachment 597918 [details]
dmesg
Comment 2 Cristian Ciupitu 2012-07-12 19:27:11 EDT
Created attachment 597919 [details]
systemctl dump
Comment 3 Michal Schmidt 2012-07-13 07:00:18 EDT
(In reply to comment #0)
> There is no /dev/disk/by-label directory after entering the root
> password to enter into maintenance mode. However the by-id, by-path and
> by-uuid directories exist. `mount /mnt/...` will work.

This should be taken care of by udev. Reassigning.

Please attach the output of:
udevadm info -q all -n /dev/sr0
Comment 4 Cristian Ciupitu 2012-07-13 10:20:07 EDT
Created attachment 598082 [details]
udevadm info -q all -n /dev/sr0
Comment 5 Michal Schmidt 2012-07-13 12:36:31 EDT
ID_CDROM_MEDIA_TRACK_COUNT_DATA is not set.

Please paste the output of:
/usr/lib/udev/cdrom_id --debug /dev/sr0
Comment 6 Cristian Ciupitu 2012-07-13 16:21:41 EDT
Created attachment 598171 [details]
/usr/lib/udev/cdrom_id --debug /dev/sr0
Comment 7 Harald Hoyer 2012-07-16 08:20:06 EDT
info_scsi_cmd_err: GET CONFIGURATION failed
Comment 8 Harald Hoyer 2012-07-16 11:04:49 EDT
I would assign that to qemu. qemu should implement those basic scsi cdrom cmds.
Comment 9 Paolo Bonzini 2012-09-11 06:28:18 EDT
QEMU actually implements GET CONFIGURATION, but perhaps not enough of it.
Comment 10 Fedora End Of Life 2013-07-03 22:24:20 EDT
This message is a reminder that Fedora 17 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 17. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '17'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 17's end of life.

Bug Reporter:  Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 17 is end of life. If you 
would still like  to see this bug fixed and are able to reproduce it 
against a later version  of Fedora, you are encouraged  change the 
'version' to a later Fedora version prior to Fedora 17's end of life.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.
Comment 11 Cole Robinson 2013-07-11 16:04:22 EDT
Seems to work fine for me on F19 with an F19 guest. Since F17 isn't long for this world, closing as CURRENTRELEASE, anyone please reopen if they can still reproduce.