bitkeeper revision 1.1159.258.142 (428df12661vmA7WwXT170kC1Qyxpxw)

Pass CD-ROM type info through from blkback to blkfront, and interpret
correctly in blkfront. Data accesses still cause buffer underruns in
domain0 though...
Signed-off-by: Keir Fraser <keir@xensource.com>
This commit is contained in:
kaf24@firebug.cl.cam.ac.uk committed 2005-05-20 14:16:06 +00:00
1 parent 642d033332
commit 186965e1ed
2 files changed
+13 -22

No files matched your search

@@ -65,7 +65,7 @@ void vbd_create(blkif_be_vbd_create_t *create)
vbd->vdevice = vdevice;
vbd->readonly = create->readonly;
vbd->type = VDISK_TYPE_DISK | VDISK_FLAG_VIRT;
vbd->type = VDISK_TYPE_DISK;
vbd->extents = NULL;
spin_lock(&blkif->vbd_lock);
@@ -163,6 +163,9 @@ void vbd_grow(blkif_be_vbd_grow_t *grow)
else
sz = x->bdev->bd_disk->capacity;
vbd->type = (x->bdev->bd_disk->flags & GENHD_FL_CD) ?
VDISK_TYPE_CDROM : VDISK_TYPE_DISK;
#else
if( !blk_size[MAJOR(x->extent.device)] )
{
@@ -278,15 +278,15 @@ struct gendisk *xlvbd_alloc_gendisk(
di->mi = mi;
di->xd_device = disk->device;
/* Full disk rather than a single partition? */
if ((minor & ((1 << mi->type->partn_shift) - 1)) == 0)
if ((VDISK_TYPE(disk->info) == VDISK_TYPE_DISK) &&
((minor & ((1 << mi->type->partn_shift) - 1)) == 0))
nr_minors = 1 << mi->type->partn_shift;
gd = alloc_disk(nr_minors);
if ( !gd )
goto out;
if ( nr_minors > 1 ) /* full disk? */
if ((VDISK_TYPE(disk->info) != VDISK_TYPE_DISK) || (nr_minors > 1))
sprintf(gd->disk_name, "%s%c", mi->type->diskname,
'a' + mi->index * mi->type->disks_per_major +
(minor >> mi->type->partn_shift));
@@ -305,6 +305,12 @@ struct gendisk *xlvbd_alloc_gendisk(
if ((xlbd_blk_queue == NULL) && xlvbd_blk_queue_alloc(mi->type))
goto out_gendisk;
if (VDISK_READONLY(disk->info))
set_disk_ro(gd, 1);
if (VDISK_TYPE(disk->info) == VDISK_TYPE_CDROM)
gd->flags |= GENHD_FL_REMOVABLE | GENHD_FL_CD;
gd->queue = xlbd_blk_queue;
add_disk(gd);
return gd;
@@ -347,24 +353,6 @@ static int xlvbd_device_add(struct list_head *list, vdisk_t *disk)
if (gd == NULL)
goto out_bd;
if (VDISK_READONLY(disk->info))
set_disk_ro(gd, 1);
switch (VDISK_TYPE(disk->info)) {
case VDISK_TYPE_CDROM:
gd->flags |= GENHD_FL_REMOVABLE | GENHD_FL_CD;
break;
case VDISK_TYPE_FLOPPY:
case VDISK_TYPE_TAPE:
gd->flags |= GENHD_FL_REMOVABLE;
break;
case VDISK_TYPE_DISK:
break;
default:
WPRINTK("unknown device type %d\n", VDISK_TYPE(disk->info));
break;
}
list_add(&new->list, list);
out_bd:
bdput(bd);
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.