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

[Xen-devel] Re: About block device mapping for guests

To: xen-devel@xxxxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] Re: About block device mapping for guests
From: Nuutti Kotivuori <naked@xxxxxx>
Date: Wed, 29 Dec 2004 00:31:24 +0200
Cache-post-path: aka.i.naked.iki.fi!unknown@xxxxxxxxxxxxxxxxxx
Cancel-lock: sha1:nZUyibsOFpThFhnXP1ZLnGY2sFE=
Delivery-date: Tue, 28 Dec 2004 22:32:34 +0000
Envelope-to: xen+James.Bulpin@xxxxxxxxxxxx
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>
Organization: Ye 'Ol Disorganized NNTPCache groupie
References: <874qiexwwx.fsf@xxxxxxxxxxxxxxxxxx> <87r7liwfb5.fsf@xxxxxxxxxxxxxxxxxx> <Prayer.1.0.11.0412241409190.7323@xxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-admin@xxxxxxxxxxxxxxxxxxxxx
User-agent: Gnus/5.1007 (Gnus v5.10.7) XEmacs/21.4 (Security Through Obscurity, linux)
M. A. Williamson wrote:
> The guest operating system (e.g. XenLinux) will bind the major /
> minor to a name according to it's own policy. e.g. under Linux 0x801
> is conventionally /dev/sda1 so unless you have a weird setup, that's
> what it'll appear as. I guess the files appear under SysFS similarly
> to how devices with the same major / minor would under vanilla
> Linux.

Well, I dug into this more deeply, since the argument seemed a bit
odd. To be able to convert 0x801 to a name, there has to be a mapping
table for it somewhere inside the kernel - and in vanilla linux, there
is none, since it is the driver that assigns both the sysfs name and
the major device number.

So I looked into the code and found this:

,----[ drivers/xen/blkfront/vbd.c ]
| static struct xlbd_type_info xlbd_ide_type = {
|        .partn_shift = 6,
|        .partn_per_major = 2,
|        // XXXcl todo blksize_size[major]  = 1024;
|        .hardsect_size = 512,
|        .max_sectors = 128,  /* 'hwif->rqsize' if we knew it */
|        // XXXcl todo read_ahead[major]    = 8; /* from 
drivers/ide/ide-probe.c */
|        .name = "hd",
| };
| 
| static struct xlbd_type_info xlbd_scsi_type = {
|        .partn_shift = 4,
|        .partn_per_major = 16,
|        // XXXcl todo blksize_size[major]  = 1024; /* XXX 512; */
|        .hardsect_size = 512,
|        .max_sectors = 128*8, /* XXX 128; */
|        // XXXcl todo read_ahead[major]    = 0; /* XXX 8; -- guessing */
|        .name = "sd",
| };
| 
| static struct xlbd_type_info xlbd_vbd_type = {
|        .partn_shift = 4,
|        .partn_per_major = 16,
|        // XXXcl todo blksize_size[major]  = 512;
|        .hardsect_size = 512,
|        .max_sectors = 128,
|        // XXXcl todo read_ahead[major]    = 8;
|        .name = "xvd",
| };
`----

And that answers all my remaining questions :-)

Thanks,
-- Naked



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/xen-devel

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