From 803965dcdf1b9a4189bf27dfb153d36f373da3fe Mon Sep 17 00:00:00 2001 From: Christian Limpach Date: Tue, 11 Sep 2007 16:38:13 +0100 Subject: [PATCH] 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 --- drivers/xen/blkfront/blkfront.c | 8 ++++++++ 1 file changed, 8 insertions(+) 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);*/ -- 2.39.5