aboutsummaryrefslogtreecommitdiffstats
path: root/include/xen/interface/io/blkif.h
diff options
context:
space:
mode:
authorGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
committerGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
commitc71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch)
treeecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /include/xen/interface/io/blkif.h
parentea53c912f8a86a8567697115b6a0d8152beee5c8 (diff)
parent6a00f206debf8a5c8899055726ad127dbeeed098 (diff)
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts: litmus/sched_cedf.c
Diffstat (limited to 'include/xen/interface/io/blkif.h')
-rw-r--r--include/xen/interface/io/blkif.h50
1 files changed, 45 insertions, 5 deletions
diff --git a/include/xen/interface/io/blkif.h b/include/xen/interface/io/blkif.h
index c2d1fa4dc1ee..3d5d6db864fe 100644
--- a/include/xen/interface/io/blkif.h
+++ b/include/xen/interface/io/blkif.h
@@ -45,17 +45,26 @@ typedef uint64_t blkif_sector_t;
45#define BLKIF_OP_WRITE_BARRIER 2 45#define BLKIF_OP_WRITE_BARRIER 2
46 46
47/* 47/*
48 * Recognised if "feature-flush-cache" is present in backend xenbus
49 * info. A flush will ask the underlying storage hardware to flush its
50 * non-volatile caches as appropriate. The "feature-flush-cache" node
51 * contains a boolean indicating whether flush requests are likely to
52 * succeed or fail. Either way, a flush request may fail at any time
53 * with BLKIF_RSP_EOPNOTSUPP if it is unsupported by the underlying
54 * block-device hardware. The boolean simply indicates whether or not it
55 * is worthwhile for the frontend to attempt flushes. If a backend does
56 * not recognise BLKIF_OP_WRITE_FLUSH_CACHE, it should *not* create the
57 * "feature-flush-cache" node!
58 */
59#define BLKIF_OP_FLUSH_DISKCACHE 3
60/*
48 * Maximum scatter/gather segments per request. 61 * Maximum scatter/gather segments per request.
49 * This is carefully chosen so that sizeof(struct blkif_ring) <= PAGE_SIZE. 62 * This is carefully chosen so that sizeof(struct blkif_ring) <= PAGE_SIZE.
50 * NB. This could be 12 if the ring indexes weren't stored in the same page. 63 * NB. This could be 12 if the ring indexes weren't stored in the same page.
51 */ 64 */
52#define BLKIF_MAX_SEGMENTS_PER_REQUEST 11 65#define BLKIF_MAX_SEGMENTS_PER_REQUEST 11
53 66
54struct blkif_request { 67struct blkif_request_rw {
55 uint8_t operation; /* BLKIF_OP_??? */
56 uint8_t nr_segments; /* number of segments */
57 blkif_vdev_t handle; /* only for read/write requests */
58 uint64_t id; /* private guest value, echoed in resp */
59 blkif_sector_t sector_number;/* start sector idx on disk (r/w only) */ 68 blkif_sector_t sector_number;/* start sector idx on disk (r/w only) */
60 struct blkif_request_segment { 69 struct blkif_request_segment {
61 grant_ref_t gref; /* reference to I/O buffer frame */ 70 grant_ref_t gref; /* reference to I/O buffer frame */
@@ -65,6 +74,16 @@ struct blkif_request {
65 } seg[BLKIF_MAX_SEGMENTS_PER_REQUEST]; 74 } seg[BLKIF_MAX_SEGMENTS_PER_REQUEST];
66}; 75};
67 76
77struct blkif_request {
78 uint8_t operation; /* BLKIF_OP_??? */
79 uint8_t nr_segments; /* number of segments */
80 blkif_vdev_t handle; /* only for read/write requests */
81 uint64_t id; /* private guest value, echoed in resp */
82 union {
83 struct blkif_request_rw rw;
84 } u;
85};
86
68struct blkif_response { 87struct blkif_response {
69 uint64_t id; /* copied from request */ 88 uint64_t id; /* copied from request */
70 uint8_t operation; /* copied from request */ 89 uint8_t operation; /* copied from request */
@@ -91,4 +110,25 @@ DEFINE_RING_TYPES(blkif, struct blkif_request, struct blkif_response);
91#define VDISK_REMOVABLE 0x2 110#define VDISK_REMOVABLE 0x2
92#define VDISK_READONLY 0x4 111#define VDISK_READONLY 0x4
93 112
113/* Xen-defined major numbers for virtual disks, they look strangely
114 * familiar */
115#define XEN_IDE0_MAJOR 3
116#define XEN_IDE1_MAJOR 22
117#define XEN_SCSI_DISK0_MAJOR 8
118#define XEN_SCSI_DISK1_MAJOR 65
119#define XEN_SCSI_DISK2_MAJOR 66
120#define XEN_SCSI_DISK3_MAJOR 67
121#define XEN_SCSI_DISK4_MAJOR 68
122#define XEN_SCSI_DISK5_MAJOR 69
123#define XEN_SCSI_DISK6_MAJOR 70
124#define XEN_SCSI_DISK7_MAJOR 71
125#define XEN_SCSI_DISK8_MAJOR 128
126#define XEN_SCSI_DISK9_MAJOR 129
127#define XEN_SCSI_DISK10_MAJOR 130
128#define XEN_SCSI_DISK11_MAJOR 131
129#define XEN_SCSI_DISK12_MAJOR 132
130#define XEN_SCSI_DISK13_MAJOR 133
131#define XEN_SCSI_DISK14_MAJOR 134
132#define XEN_SCSI_DISK15_MAJOR 135
133
94#endif /* __XEN_PUBLIC_IO_BLKIF_H__ */ 134#endif /* __XEN_PUBLIC_IO_BLKIF_H__ */