[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] IDE CD-ROM drive problem

> I ran into a regression between 1.1 and unstable in the xl_block
> driver related to IDE CD-ROM drives.  The drive is correctly
> detected at boot both by Xen and Xenolinux, but when I attempt to
> mount it, like so:
> mount /dev/hda /mnt
> I get the error "/dev/hda is not a valid block device."

First question: is there a CD-Rom in the drive at boot time? In the 
current world we're not so good at detecting things like CDs being 
inserted or removed.... 

> The problems seems to be in this section of code in xenolinux_block_open() in
> xl_block.c:
>    if(!gd->part[minor].nr_sects) {
>         /* Device either doesn't exist, or has zero capacity; we use
>            a few cheesy heuristics to return the relevant error code */
>         if(disk->capacity || (minor & (gd->max_p - 1))) {
>             // we have a real device, but no such partition, or we just
>             // have a partition number so guess this is the problem
>             return -ENXIO;     // no such device or address
>         } else if (gd->flags[minor >> gd->minor_shift] & GENHD_FL_REMOVABLE) {
>             // this is a removable device => assume that media is missing
>             return -ENOMEDIUM; // media not present (this is a guess)
>         } else
>             // just go for the general 'no such device' error
>             return -ENODEV;    // no such device
>     }

Indeed - as the comments indicate, this is pretty gross stuff trying 
to work around the fact that we didn't bother porting all the cdrom 
stuff to do with media (and audio stuff etc). 

However I'd expect it to 'work' in the sense that it should produce 
the error "mount: No medium found" if there's no CD in the drive, or 
never trigger this if code if there was a CD in the drive at boot
time. If you're getting "Not a valid block device" that seems like 
something else is going on... 

Can you post the output from Xen and XenoLinux booting if you have it?

> If I remove this code, I can mount the CD-ROM with no difficulty.  I've been
> investigating the problem myself, but I figured I'd forward to the experts in
> charge who have been into this code a lot more than I have.

Removing it completely is not the right thing to do, although it may 
well need to be fixed 'properly' (i.e. pull in all the cdrom crap :-( 



This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
Xen-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.