]> xenbits.xensource.com Git - xenclient/kernel.git/commitdiff
Add the CDROM_GET_CAPABILITY ioctl to blkfront.
authorChristian Limpach <Christian.Limpach@xensource.com>
Tue, 11 Sep 2007 15:38:13 +0000 (16:38 +0100)
committerChristian Limpach <Christian.Limpach@xensource.com>
Tue, 11 Sep 2007 15:38:13 +0000 (16:38 +0100)
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 <Christian.Limpach@xensource.com>
drivers/xen/blkfront/blkfront.c

index d13a63f6d5fcd36d032c6d8b055251f75f605000..964df65990eda3e2691025417f820f84fcb3d322 100644 (file)
@@ -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);*/