Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 312452 Details for
Bug 442723
Xen Support more than 16 disk devices (kernel)
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Expand blkfront to recognize the new expanded xvd devices
linux-2.6.18-expand-xvd-blkfront.patch (text/plain), 6.05 KB, created by
Chris Lalancette
on 2008-07-23 10:07:23 UTC
(
hide
)
Description:
Expand blkfront to recognize the new expanded xvd devices
Filename:
MIME Type:
Creator:
Chris Lalancette
Created:
2008-07-23 10:07:23 UTC
Size:
6.05 KB
patch
obsolete
>diff -urp linux-2.6.18.noarch.patch1/drivers/xen/blkfront/blkfront.c linux-2.6.18.noarch/drivers/xen/blkfront/blkfront.c >--- linux-2.6.18.noarch.patch1/drivers/xen/blkfront/blkfront.c 2008-07-14 22:15:39.000000000 +0200 >+++ linux-2.6.18.noarch/drivers/xen/blkfront/blkfront.c 2008-07-14 22:19:10.000000000 +0200 >@@ -88,8 +88,13 @@ static int blkfront_probe(struct xenbus_ > err = xenbus_scanf(XBT_NIL, dev->nodename, > "virtual-device", "%i", &vdevice); > if (err != 1) { >- xenbus_dev_fatal(dev, err, "reading virtual-device"); >- return err; >+ /* go looking in the extended area instead */ >+ err = xenbus_scanf(XBT_NIL, dev->nodename, "virtual-device-ext", >+ "%i", &vdevice); >+ if (err != 1) { >+ xenbus_dev_fatal(dev, err, "reading virtual-device"); >+ return err; >+ } > } > > info = kzalloc(sizeof(*info), GFP_KERNEL); >diff -urp linux-2.6.18.noarch.patch1/drivers/xen/blkfront/vbd.c linux-2.6.18.noarch/drivers/xen/blkfront/vbd.c >--- linux-2.6.18.noarch.patch1/drivers/xen/blkfront/vbd.c 2008-07-14 22:17:26.000000000 +0200 >+++ linux-2.6.18.noarch/drivers/xen/blkfront/vbd.c 2008-07-14 22:20:08.000000000 +0200 >@@ -39,6 +39,11 @@ > #define BLKIF_MAJOR(dev) ((dev)>>8) > #define BLKIF_MINOR(dev) ((dev) & 0xff) > >+#define EXT_SHIFT 28 >+#define EXTENDED (1<<EXT_SHIFT) >+#define VDEV_IS_EXTENDED(dev) ((dev)&(EXTENDED)) >+#define BLKIF_MINOR_EXT(dev) ((dev)&(~EXTENDED)) >+ > /* > * For convenience we distinguish between ide, scsi and 'other' (i.e., > * potentially combinations of the two) in the naming scheme and in a few other >@@ -47,7 +52,7 @@ > > #define NUM_IDE_MAJORS 10 > #define NUM_SCSI_MAJORS 17 >-#define NUM_VBD_MAJORS 1 >+#define NUM_VBD_MAJORS 2 > > static struct xlbd_type_info xlbd_ide_type = { > .partn_shift = 6, >@@ -70,6 +75,13 @@ static struct xlbd_type_info xlbd_vbd_ty > .diskname = "xvd", > }; > >+static struct xlbd_type_info xlbd_vbd_type_ext = { >+ .partn_shift = 8, >+ .disks_per_major = 256, >+ .devname = "xvd", >+ .diskname = "xvd", >+}; >+ > static struct xlbd_major_info *major_info[NUM_IDE_MAJORS + NUM_SCSI_MAJORS + > NUM_VBD_MAJORS]; > >@@ -81,10 +93,6 @@ static struct xlbd_major_info *major_inf > #define XLBD_MAJOR_SCSI_RANGE XLBD_MAJOR_SCSI_START ... XLBD_MAJOR_VBD_START - 1 > #define XLBD_MAJOR_VBD_RANGE XLBD_MAJOR_VBD_START ... XLBD_MAJOR_VBD_START + NUM_VBD_MAJORS - 1 > >-/* Information about our VBDs. */ >-#define MAX_VBDS 64 >-static LIST_HEAD(vbds_list); >- > static struct block_device_operations xlvbd_block_fops = > { > .owner = THIS_MODULE, >@@ -100,12 +108,14 @@ static struct xlbd_major_info * > xlbd_alloc_major_info(int major, int minor, int index) > { > struct xlbd_major_info *ptr; >+ int do_register; > > ptr = kzalloc(sizeof(struct xlbd_major_info), GFP_KERNEL); > if (ptr == NULL) > return NULL; > > ptr->major = major; >+ do_register = 1; > > switch (index) { > case XLBD_MAJOR_IDE_RANGE: >@@ -117,32 +127,40 @@ xlbd_alloc_major_info(int major, int min > ptr->index = index - XLBD_MAJOR_SCSI_START; > break; > case XLBD_MAJOR_VBD_RANGE: >- ptr->type = &xlbd_vbd_type; >- ptr->index = index - XLBD_MAJOR_VBD_START; >+ ptr->index = 0; >+ if ((index - XLBD_MAJOR_VBD_START) == 0) >+ ptr->type = &xlbd_vbd_type; >+ else >+ ptr->type = &xlbd_vbd_type_ext; >+ >+ /* >+ * if someone already registered block major 202, >+ * don't try to register it again >+ */ >+ if (major_info[XLBD_MAJOR_VBD_START] != NULL) >+ do_register = 0; > break; > } > >- printk("Registering block device major %i\n", ptr->major); >- if (register_blkdev(ptr->major, ptr->type->devname)) { >- WPRINTK("can't get major %d with name %s\n", >- ptr->major, ptr->type->devname); >- kfree(ptr); >- return NULL; >+ if (do_register) { >+ printk("Registering block device major %i\n", ptr->major); >+ if (register_blkdev(ptr->major, ptr->type->devname)) { >+ WPRINTK("can't get major %d with name %s\n", >+ ptr->major, ptr->type->devname); >+ kfree(ptr); >+ return NULL; >+ } > } > >-/* devfs_mk_dir(ptr->type->devname);*/ > major_info[index] = ptr; > return ptr; > } > > static struct xlbd_major_info * >-xlbd_get_major_info(int vdevice) >+xlbd_get_major_info(int major, int minor, int vdevice) > { > struct xlbd_major_info *mi; >- int major, minor, index; >- >- major = BLKIF_MAJOR(vdevice); >- minor = BLKIF_MINOR(vdevice); >+ int index; > > switch (major) { > case IDE0_MAJOR: index = 0; break; >@@ -163,7 +181,12 @@ xlbd_get_major_info(int vdevice) > index = 18 + major - SCSI_DISK8_MAJOR; > break; > case SCSI_CDROM_MAJOR: index = 26; break; >- default: index = 27; break; >+ default: >+ if (!VDEV_IS_EXTENDED(vdevice)) >+ index = 27; >+ else >+ index = 28; >+ break; > } > > mi = ((major_info[index] != NULL) ? major_info[index] : >@@ -212,7 +235,7 @@ xlvbd_init_blk_queue(struct gendisk *gd, > } > > static int >-xlvbd_alloc_gendisk(int minor, blkif_sector_t capacity, int vdevice, >+xlvbd_alloc_gendisk(int major, int minor, blkif_sector_t capacity, int vdevice, > u16 vdisk_info, u16 sector_size, > struct blkfront_info *info) > { >@@ -226,7 +249,7 @@ xlvbd_alloc_gendisk(int minor, blkif_sec > BUG_ON(info->mi != NULL); > BUG_ON(info->rq != NULL); > >- mi = xlbd_get_major_info(vdevice); >+ mi = xlbd_get_major_info(major, minor, vdevice); > if (mi == NULL) > goto out; > info->mi = mi; >@@ -304,15 +327,30 @@ xlvbd_add(blkif_sector_t capacity, int v > { > struct block_device *bd; > int err = 0; >+ int major, minor; >+ >+ if ((vdevice>>EXT_SHIFT) > 1) { >+ /* this is above the extended range; something is wrong */ >+ printk(KERN_WARNING "blkfront: vdevice 0x%x is above the extended range; ignoring\n", vdevice); >+ return -ENODEV; >+ } > >- info->dev = MKDEV(BLKIF_MAJOR(vdevice), BLKIF_MINOR(vdevice)); >+ if (!VDEV_IS_EXTENDED(vdevice)) { >+ major = BLKIF_MAJOR(vdevice); >+ minor = BLKIF_MINOR(vdevice); >+ } >+ else { >+ major = 202; >+ minor = BLKIF_MINOR_EXT(vdevice); >+ } > >+ info->dev = MKDEV(major, minor); > bd = bdget(info->dev); > if (bd == NULL) > return -ENODEV; > >- err = xlvbd_alloc_gendisk(BLKIF_MINOR(vdevice), capacity, vdevice, >- vdisk_info, sector_size, info); >+ err = xlvbd_alloc_gendisk(major, minor, capacity, vdevice, vdisk_info, >+ sector_size, info); > > bdput(bd); > return err;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 442723
:
312451
| 312452 |
312453