|
|
|
|
|
|
|
|
|
|
xen-devel
[Xen-devel] [PATCH 2/3]: Blktap kernel compat layer
The kernel side of the blktap extended vbd compatibility layer.
Signed-off-by: Chris Lalancette <clalance@xxxxxxxxxx>
diff -r db4f08203b8a drivers/xen/blktap/blktap.c
--- a/drivers/xen/blktap/blktap.c Tue Jul 08 09:31:24 2008 +0100
+++ b/drivers/xen/blktap/blktap.c Wed Jul 09 02:13:03 2008 +0200
@@ -89,8 +89,13 @@
/*Data struct handed back to userspace for tapdisk device to VBD mapping*/
typedef struct domid_translate {
unsigned short domid;
+ unsigned short busid;
+} domid_translate_t ;
+
+typedef struct domid_translate_ext {
+ unsigned short domid;
u32 busid;
-} domid_translate_t ;
+} domid_translate_ext_t ;
/*Data struct associated with each of the tapdisk devices*/
typedef struct tap_blkif {
@@ -110,7 +115,7 @@
unsigned long *idx_map; /*Record the user ring id to kern
[req id, idx] tuple */
blkif_t *blkif; /*Associate blkif with tapdev */
- struct domid_translate trans; /*Translation from domid to bus. */
+ struct domid_translate_ext trans; /*Translation from domid to bus. */
} tap_blkif_t;
static struct tap_blkif *tapfds[MAX_TAP_DEV];
@@ -213,6 +218,7 @@
#define BLKTAP_IOCTL_MAJOR 7
#define BLKTAP_QUERY_ALLOC_REQS 8
#define BLKTAP_IOCTL_FREEINTF 9
+#define BLKTAP_IOCTL_NEWINTF_EXT 50
#define BLKTAP_IOCTL_PRINT_IDXS 100
/* blktap switching modes: (Set with BLKTAP_IOCTL_SETMODE) */
@@ -782,6 +788,26 @@
}
info->trans.domid = tr->domid;
info->trans.busid = tr->busid;
+ return info->minor;
+ }
+ case BLKTAP_IOCTL_NEWINTF_EXT:
+ {
+ void __user *udata = (void __user *) arg;
+ domid_translate_ext_t tr;
+
+ if (copy_from_user(&tr, udata, sizeof(domid_translate_ext_t)))
+ return -EFAULT;
+
+ DPRINTK("NEWINTF_EXT Req for domid %d and bus id %d\n",
+ tr.domid, tr.busid);
+ info = get_next_free_dev();
+ if (!info) {
+ WPRINTK("Error initialising /dev/xen/blktap - "
+ "No more devices\n");
+ return -1;
+ }
+ info->trans.domid = tr.domid;
+ info->trans.busid = tr.busid;
return info->minor;
}
case BLKTAP_IOCTL_FREEINTF:
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|
<Prev in Thread] |
Current Thread |
[Next in Thread> |
- [Xen-devel] [PATCH 2/3]: Blktap kernel compat layer,
Chris Lalancette <=
|
|
|
|
|