Bug 647794

Summary: RHEL 6 guest sees only blank media
Product: Red Hat Enterprise Linux 6 Reporter: Lubos Kocman <lkocman>
Component: udevAssignee: Harald Hoyer <harald>
Status: CLOSED ERRATA QA Contact: qe-baseos-daemons
Severity: medium Docs Contact:
Priority: medium    
Version: 6.1CC: gcase, harald, mkenneth, pknirsch, syeghiay, szhou, tburke, virt-maint
Target Milestone: rcKeywords: Triaged
Target Release: 6.1   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: udev-147-2.34.el6 Doc Type: Bug Fix
Doc Text:
In a virtual machine with an iDRAC virtual CDROM, the CDROM could not be mounted from the Desktop, because /lib/udev/cdrom_id failed to get the correct information about the drive and medium. /lib/udev/cdrom_id has been fixed to correctly read information about the drive and medium of an iDRAC virtual drive.
Story Points: ---
Clone Of:
: 680194 (view as bug list) Environment:
Last Closed: 2011-05-19 11:49:19 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: 580951, 580953, 580954, 680194    
Attachments:
Description Flags
gvfs-mount -li
none
udevadm info --export-db
none
udisks --dump none

Description Lubos Kocman 2010-10-29 13:31:35 UTC
Description of problem:

RHEL 6 guest sees blank media except of the content which should be displayed.

Version-Release number of selected component (if applicable):

qemu-kvm-0.12.1.2-2.113.el6.x86_64 on the host
hal-0.5.14-8.el6.i686

THIS DOESN'T HAPPEN ON FEDORA OR WINDOWS GUESTS

How reproducible:


Steps to Reproduce:
1. qemu-kvm -cdrom path/to/populated_dvd_iso
2. connect to guest
  
Actual results:

Blank dvd media is auto-mounted
However if you'll manually mount /dev/cdrom then data is available

Expected results:

valid image should be mounted

Additional info:

[shadowman@gst-rhel6x64 ~]$ dmesg | grep -i rom
ata2.00: ATAPI: QEMU DVD-ROM, 0.12.1, max UDMA/100
scsi 1:0:0:0: CD-ROM QEMU QEMU DVD-ROM 0.12 PQ: 0 ANSI: 5
Uniform CD-ROM driver Revision: 3.20
sr 1:0:0:0: Attached scsi CD-ROM sr0

Comment 1 Richard Hughes 2010-11-01 10:02:02 UTC
HAL isn't mounting the media in RHEL 6. I'll reassign to udisks where David can help more.

Comment 2 Lubos Kocman 2010-11-22 13:37:30 UTC
This is pretty big issue for RHEL6 kvm users any progress here?

Comment 3 David Zeuthen 2010-11-22 16:11:00 UTC
This bug report does not have enough information. Please attach the information requested here:

 http://www.freedesktop.org/wiki/Software/udisks

in particular I will need

 - the output of 'udisks --dump'
 - the output of 'udevadm info --export-db' (as root)
 - the output of 'gvfs-mount -li' captured from the
   desktop session as the user (not root)

Comment 5 Lubos Kocman 2010-12-20 16:07:29 UTC
Created attachment 469802 [details]
gvfs-mount -li

Comment 6 Lubos Kocman 2010-12-20 16:08:20 UTC
Created attachment 469804 [details]
udevadm info --export-db

Comment 7 Lubos Kocman 2010-12-20 16:09:06 UTC
Created attachment 469806 [details]
udisks --dump

Comment 8 David Zeuthen 2010-12-20 16:19:01 UTC
Comment on attachment 469802 [details]
gvfs-mount -li

Ugh, please pay attention to MIME types so files open properly in the browser etc.

Comment 9 David Zeuthen 2010-12-20 16:25:28 UTC
OK, so the problem is here - from udevadm info --export-db:

 P: /devices/pci0000:00/0000:00:01.1/host1/target1:0:0/1:0:0:0/block/sr0
 <snip>
 E: ID_CDROM=1
 E: ID_CDROM_MRW=1
 E: ID_CDROM_MRW_W=1
 E: ID_CDROM_MEDIA=1
 E: ID_CDROM_MEDIA_DVD=1
 E: ID_CDROM_MEDIA_STATE=blank
 E: ID_CDROM_MEDIA_TRACK_COUNT_DATA=1
 <snip>
 E: ID_FS_LABEL=Fedora_14_i386_DVD
 E: ID_FS_LABEL_ENC=Fedora\x2014\x20i386\x20DVD
 E: ID_FS_TYPE=iso9660
 E: ID_FS_USAGE=filesystem

The problem is that udev's cdrom_id marks the state as blank while it really isn't (ID_FS_* suggests there's actually stuff on the media - but udisks/gvfs/desktop looks at MEDIA_STATE before it looks at ID_FS_*).

So this is either a problem with QEMU's cd-rom "hardware" or udev's cdrom_id. 
IIRC there were a couple of fixes to udev's cdrom_id program that fixes this very problem so reassigning to udev for now. Harald?

Thanks,
David

Comment 10 Lubos Kocman 2010-12-20 16:26:49 UTC
Hello I found useful information:

#---------------------------------------------------

seems like it could be a problem with size of the iso.

#---------------------------------------------------
The issue did not occur on following file:

file ../ic60/RHEV-toolsSetup_2.3_130.iso 
../ic60/RHEV-toolsSetup_2.3_130.iso: ISO 9660 CD-ROM filesystem data
'RHEV-tools'

-rwxrwxrwx. 1 lkocman users 124M Dec  6 10:07 RHEV-toolsSetup_2.3_130.iso



But occured on this file and other dvd iso images.

[lkocman@dhcp-28-248 ISO]$ file Fedora-13-i386-DVD.iso 
Fedora-13-i386-DVD.iso: ISO 9660 CD-ROM filesystem data 'Fedora 13 i386 DVD    
        ' (bootable)


[lkocman@dhcp-28-248 ISO]$ ls -lah Fedora-13-i386-DVD.iso 
-rwxrwxrwx. 1 lkocman users 3.1G Jul 23 03:55 Fedora-13-i386-DVD.iso

Comment 11 Phil Knirsch 2010-12-22 12:04:14 UTC
If qemu is delivering that information wrongly there isn't much udev can do about this, so reassigning it to qemu.

Thanks & regards, Phil

Comment 12 Harald Hoyer 2011-01-20 08:41:40 UTC
In particular:

scsi command 0x51 READ DISC INFORMATION

        static const char *media_status[] = {
                "blank",
                "appendable",
                "complete",
                "other"
        };

        cd_media_state = media_status[header[2] & 3];


header[2] & 3 == 0 here, but should be 2

Comment 13 Markus Armbruster 2011-01-21 13:43:28 UTC
ide_atapi_cmd() in qemu/hw/ide/core.c doesn't implement 0x51.  This should result in an IDE error: SENSE_ILLEGAL_REQUEST, ASC_ILLEGAL_OPCODE.  I wonder why that doesn't arrive in guest userland.  Regardless, I figure we better implement 0x51.  Upstream first.

Comment 14 Shirley Zhou 2011-02-21 03:28:05 UTC
*** Bug 662606 has been marked as a duplicate of this bug. ***

Comment 15 Markus Armbruster 2011-02-24 16:04:17 UTC
I just cloned to gug 680194 - RFE: Implement ATAPI command 0x51 READ DISC INFORMATION.

This bug is now only about ATAPI 0x51 failing sanely, getting that errors to guest userspace, and getting it handled correctly there.

I verified that the error is propagated correctly from qemu-kvm to guest userspace.  It's clearly visible in strace (ioctl SG_IO SG_DXFER_FROM_DEV shows info=0x01, and correct sense data in sb[]).  Assigning back to udev.

Comment 17 Harald Hoyer 2011-02-24 16:17:22 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:
In a virtual machine with an iDRAC virtual CDROM, the CDROM could not be mounted from the Desktop, because /lib/udev/cdrom_id failed to get the correct information about the drive and medium. 
/lib/udev/cdrom_id has been fixed to correctly read information about the drive and medium of an iDRAC virtual drive.

Comment 18 Cole Robinson 2011-03-10 18:35:27 UTC
*** Bug 649411 has been marked as a duplicate of this bug. ***

Comment 20 errata-xmlrpc 2011-05-19 11:49:19 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2011-0525.html