[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [linux-2.6.18-xen] Add the CDROM_GET_CAPABILITY ioctl to blkfront.



# HG changeset patch
# User Christian Limpach <Christian.Limpach@xxxxxxxxxxxxx>
# Date 1189525093 -3600
# Node ID d2bd9af846b5c3fbb8879a01a29cdfc44dc84f66
# Parent  099625b07ae7ea3343b7842b2148dc2125ca14eb
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 <Christian.Limpach@xxxxxxxxxxxxx>
---
 drivers/xen/blkfront/blkfront.c |    8 ++++++++
 1 files changed, 8 insertions(+)

diff -r 099625b07ae7 -r d2bd9af846b5 drivers/xen/blkfront/blkfront.c
--- a/drivers/xen/blkfront/blkfront.c   Mon Sep 10 13:59:28 2007 -0600
+++ b/drivers/xen/blkfront/blkfront.c   Tue Sep 11 16:38:13 2007 +0100
@@ -521,6 +521,14 @@ int blkif_ioctl(struct inode *inode, str
                                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);*/

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.