LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud
User Name
Password
Linux - Virtualization and Cloud This forum is for the discussion of all topics relating to Linux Virtualization and Linux Cloud platforms. Xen, KVM, OpenVZ, VirtualBox, VMware, Linux-VServer and all other Linux Virtualization platforms are welcome. OpenStack, CloudStack, ownCloud, Cloud Foundry, Eucalyptus, Nimbus, OpenNebula and all other Linux Cloud platforms are welcome. Note that questions relating solely to non-Linux OS's should be asked in the General forum.

Notices


Reply
  Search this Thread
Old 01-05-2010, 12:15 PM   #1
ang123
LQ Newbie
 
Registered: Nov 2006
Location: UK
Distribution: LFS
Posts: 7

Rep: Reputation: 0
2.6.31 kernel on VMWare - IDE Probe fails to find CD drive


Hi - is anyone running a 2.6.31 kernel as a VMWare ESX 3.5.0 guest-OS?

I've just tried upgrading the guest-OS kernel from 2.6.30.10 to 2.6.31.7 and now the virtual-CD cannot be detected. The distro is LFS-based. Boot-time kernel logs illustrating the problem are included below. Basically after boot there is no /dev/hda and no /dev/cdrom. Tried rebuilding the kernel with various config adjustments, to no avail.

Thanks in advance for any tips or advice.

2.6.30.10:
Jan 4 13:54:07 virtapp kernel: Probing IDE interface ide0...
Jan 4 13:54:07 virtapp kernel: hda: VMware Virtual IDE CDROM Drive, ATAPI CD/DVD-ROM drive
Jan 4 13:54:07 virtapp kernel: hda: host max PIO4 wanted PIO255(auto-tune) selected PIO4
Jan 4 13:54:07 virtapp kernel: hda: UDMA/33 mode selected
Jan 4 13:54:07 virtapp kernel: ide0 at 0x1f0-0x1f7,0x3f6 on irq 14

2.6.31.7:
Jan 4 13:41:09 virtapp kernel: Probing IDE interface ide0...
Jan 4 13:41:09 virtapp kernel: ide0: no devices on the port
Jan 4 13:41:09 virtapp kernel: ide0 at 0x1f0-0x1f7,0x3f6 on irq 14

Last edited by ang123; 01-11-2010 at 12:06 PM. Reason: Improve title
 
Old 01-08-2010, 04:17 AM   #2
ang123
LQ Newbie
 
Registered: Nov 2006
Location: UK
Distribution: LFS
Posts: 7

Original Poster
Rep: Reputation: 0
Hi again ... I have added some debug logging to the kernel and discovered that it is detecting /dev/hda (the cdrom) as a device - but is subsequently ignoring it...

Code:
Jan  7 18:18:46 virtapp kernel: Probing IDE interface ide0...
Jan  7 18:18:46 virtapp kernel: ANG: ide_wait_not_busy...
Jan  7 18:18:46 virtapp kernel: ANG: ide_port_for_each_dev (loop)...
Jan  7 18:18:46 virtapp kernel: ANG: device=hda rc=0
Jan  7 18:18:46 virtapp kernel: ANG: ide_port_for_each_dev (loop)...
Jan  7 18:18:46 virtapp kernel: ANG: device=hdb rc=-19
Jan  7 18:18:46 virtapp kernel: ANG: returning rc=-19
Jan  7 18:18:46 virtapp kernel: ide0: no devices on the port
Jan  7 18:18:46 virtapp kernel: ANG: ide_probe_port() returning -19
The root cause of this seems to be an explicit check for ENODEV that was added to ide_probe_port() in drivers/ide/ide-probe.c in the 2.6.31.1 kernel which unfortunately jumps over the extra check needed to detect the CDROM drive (at least, in our VM setup). I've tested this by rebuilding the kernel without the check - and the virtual CDROM is now fully functional.

Code:
        rc = ide_port_wait_ready(hwif);

>        if (rc == -ENODEV) {
>                printk(KERN_INFO "%s: no devices on the port\n", hwif->name);
>                goto out;
        } else if (rc == -EBUSY)
                printk(KERN_ERR "%s: not ready before the probe\n", hwif->name);
        else
                rc = -ENODEV;

        /*
         * Second drive should only exist if first drive was found,
         * but a lot of cdrom drives are configured as single slaves.
         */
        ide_port_for_each_dev(i, drive, hwif) {
                (void) probe_for_drive(drive);
                if (drive->dev_flags & IDE_DFLAG_PRESENT)
                        rc = 0;
        }
out: ...
So now my question is ... can I safely patch this out of my kernel?
Does anyone know why the explicit ENODEV check was added in the first place?

Thanks in advance.

Last edited by ang123; 01-11-2010 at 12:04 PM. Reason: Added [CODE] refs
 
Old 01-11-2010, 11:57 AM   #3
ang123
LQ Newbie
 
Registered: Nov 2006
Location: UK
Distribution: LFS
Posts: 7

Original Poster
Rep: Reputation: 0
Incase anyone else has the same problem.
The patch we've now tried and tested for this is:

Code:
--- linux-2.6.31.7.orig/drivers/ide/ide-probe.c 2009-12-08 19:13:50.000000000 +0000
+++ linux-2.6.31.7/drivers/ide/ide-probe.c      2010-01-08 12:59:51.000000000 +0000
@@ -685,10 +685,7 @@
                disable_irq(hwif->irq);

        rc = ide_port_wait_ready(hwif);
-       if (rc == -ENODEV) {
-               printk(KERN_INFO "%s: no devices on the port\n", hwif->name);
-               goto out;
-       } else if (rc == -EBUSY)
+       if (rc == -EBUSY)
                printk(KERN_ERR "%s: not ready before the probe\n", hwif->name);
        else
                rc = -ENODEV;
@@ -702,7 +699,11 @@
                if (drive->dev_flags & IDE_DFLAG_PRESENT)
                        rc = 0;
        }
-out:
+
+       /* if still ENODEV - then definitely no devices found   */
+       if (rc == -ENODEV)
+               printk(KERN_INFO "%s: no devices on the port\n", hwif->name);
+
        /*
         * Use cached IRQ number. It might be (and is...) changed by probe
         * code above

Last edited by ang123; 01-11-2010 at 12:03 PM. Reason: Added [CODE] refs
 
Old 01-11-2010, 03:48 PM   #4
mhwood@Ameritech.Net
LQ Newbie
 
Registered: May 2005
Distribution: ancient Slackware, Gentoo
Posts: 2

Rep: Reputation: 0
I have been *trying* to install 2.6.31 (Gentoo install-amd64-minimal-20091203) on ESXi 3.5.0 123629, but although the CDROM image boots just fine, the kernel thinks there is nothing on the IDE controller and so the initrd can't mount the CDROM it just booted from. :-{ Time to find an earlier CD image, I guess. Thanks for your notes -- at least now I have some reason to believe it's nothing *I* did wrong, and something specific to try.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Linux guest on Vmware is not communicating to other guest machines Saravana Linux - Virtualization and Cloud 2 10-25-2009 11:14 PM
VMware ESX 3.5 on Ubuntu 8.04? your_shadow03 Linux - Newbie 2 06-18-2009 05:43 AM
VMware ESX Server Echo Kilo Linux - Server 10 02-09-2008 08:22 PM
VMware esx 3 HELP jstuhlmiller Linux - Newbie 1 09-25-2007 08:02 AM
want to exchange my vmware esx 3.1 against a vmware gsx 3.1 neton Linux - Software 1 08-06-2004 08:23 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud

All times are GMT -5. The time now is 09:05 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration