WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

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

To: Evan Deaubl <evan@xxxxxxxxx>
Subject: Re: [Xen-devel] IDE CD-ROM drive problem
From: Steven Hand <Steven.Hand@xxxxxxxxxxxx>
Date: Tue, 16 Dec 2003 16:00:32 +0000
Cc: xen-devel@xxxxxxxxxxxxxxxxxxxxx
Delivery-date: Tue, 16 Dec 2003 16:09:26 +0000
Envelope-to: steven.hand@xxxxxxxxxxxx
In-reply-to: Your message of "Mon, 15 Dec 2003 21:00:29 PST." <1071550829.3fde916dc5c75@xxxxxxxxxxxxxxxxxxxx>
List-archive: <http://sourceforge.net/mailarchive/forum.php?forum=xen-devel>
List-help: <mailto:xen-devel-request@lists.sourceforge.net?subject=help>
List-id: List for Xen developers <xen-devel.lists.sourceforge.net>
List-post: <mailto:xen-devel@lists.sourceforge.net>
List-subscribe: <https://lists.sourceforge.net/lists/listinfo/xen-devel>, <mailto:xen-devel-request@lists.sourceforge.net?subject=subscribe>
List-unsubscribe: <https://lists.sourceforge.net/lists/listinfo/xen-devel>, <mailto:xen-devel-request@lists.sourceforge.net?subject=unsubscribe>
Sender: xen-devel-admin@xxxxxxxxxxxxxxxxxxxxx
> 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 :-( 

cheers, 

S.


-------------------------------------------------------
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
Xen-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/xen-devel

<Prev in Thread] Current Thread [Next in Thread>