From: Christian Limpach Date: Tue, 11 Sep 2007 15:38:13 +0000 (+0100) Subject: Add the CDROM_GET_CAPABILITY ioctl to blkfront. X-Git-Tag: xen-3.2.0~21^2^2~28^2^2~22^2^2~9^2~12^2~23^2~44^2~10 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=803965dcdf1b9a4189bf27dfb153d36f373da3fe;p=xenclient%2Fkernel.git Add the CDROM_GET_CAPABILITY ioctl to blkfront. Return 0 instead of -EINVAL if the blkfront device is a cdrom, i.e. had the VDISK_CDROM attribute. This allows udev's cdrom_id to correctly detect the device as a cdrom device. Signed-off-by: Christian Limpach --- diff --git a/drivers/xen/blkfront/blkfront.c b/drivers/xen/blkfront/blkfront.c index d13a63f6..964df659 100644 --- a/drivers/xen/blkfront/blkfront.c +++ b/drivers/xen/blkfront/blkfront.c @@ -521,6 +521,14 @@ int blkif_ioctl(struct inode *inode, struct file *filep, return -EFAULT; return 0; + case CDROM_GET_CAPABILITY: { + struct blkfront_info *info = + inode->i_bdev->bd_disk->private_data; + struct gendisk *gd = info->gd; + if (gd->flags & GENHD_FL_CD) + return 0; + return -EINVAL; + } default: /*printk(KERN_ALERT "ioctl %08x not supported by Xen blkdev\n", command);*/