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
|