ia64/xen-unstable

view xen/include/hypervisor-ifs/vbd.h @ 926:0a901de56d7c

bitkeeper revision 1.588 (3fafd2ccYgSbWe9z2kLiH-DeviUaIA)

Merge labyrinth.cl.cam.ac.uk:/auto/groups/xeno/BK/xeno.bk
into labyrinth.cl.cam.ac.uk:/local/scratch/smh22/xeno.bk
author smh22@labyrinth.cl.cam.ac.uk
date Mon Nov 10 18:02:52 2003 +0000 (2003-11-10)
parents 38ad3cea577f 4aba3a48d64f
children cfd9961afd8b 7ae6b4359a0d
line source
1 #ifndef __HYP_IFS_VBD_H__
2 #define __HYP_IFS_VBD_H__
5 /*
6 * Block I/O trap operations and associated structures.
7 */
9 #define BLOCK_IO_OP_SIGNAL 0 /* let xen know we have work to do */
10 #define BLOCK_IO_OP_RESET 1 /* reset ring indexes on quiescent i/f */
11 #define BLOCK_IO_OP_RING_ADDRESS 2 /* returns machine address of I/O ring */
12 #define BLOCK_IO_OP_VBD_CREATE 3 /* create a new VBD for a given domain */
13 #define BLOCK_IO_OP_VBD_ADD 4 /* add an extent to a given VBD */
14 #define BLOCK_IO_OP_VBD_REMOVE 5 /* remove an extent from a given VBD */
15 #define BLOCK_IO_OP_VBD_DELETE 6 /* delete a VBD */
16 #define BLOCK_IO_OP_VBD_PROBE 7 /* query VBD information for a domain */
17 #define BLOCK_IO_OP_VBD_INFO 8 /* query info about a particular VBD */
19 typedef struct _xen_extent {
20 u16 device;
21 u16 unused; // pad
22 ulong start_sector;
23 ulong nr_sectors;
24 } xen_extent_t;
28 #define VBD_MODE_R 0x1
29 #define VBD_MODE_W 0x2
31 #define VBD_CAN_READ(_v) ((_v)->mode & VBD_MODE_R)
32 #define VBD_CAN_WRITE(_v) ((_v)->mode & VBD_MODE_W)
35 typedef struct _vbd_create {
36 unsigned domain; // create VBD for this domain
37 u16 vdevice; // 16 bit id domain will refer to VBD as
38 u16 mode; // OR of { VBD_MODE_R , VBD_MODE_W }
39 } vbd_create_t;
41 typedef struct _vbd_add {
42 unsigned domain; // domain in question
43 u16 vdevice; // 16 bit id domain refers to VBD as
44 xen_extent_t extent; // the extent to add to this VBD
45 } vbd_add_t;
47 typedef struct _vbd_remove {
48 unsigned domain; // domain in question
49 u16 vdevice; // 16 bit id domain refers to VBD as
50 xen_extent_t extent; // the extent to remove from this VBD
51 } vbd_remove_t;
54 typedef struct _vbd_delete {
55 unsigned domain; // domain in question
56 u16 vdevice; // 16 bit id domain refers to VBD as
57 } vbd_delete_t;
59 #define VBD_PROBE_ALL 0xFFFFFFFF
60 typedef struct _vbd_probe {
61 unsigned domain; // domain in question or VBD_PROBE_ALL
62 xen_disk_info_t xdi; // where's our space for VBD/disk info
63 } vbd_probe_t;
65 typedef struct _vbd_info {
66 unsigned domain; // domain in question
67 u16 vdevice; // 16 bit id domain refers to VBD as
68 u16 nextents; // max no. of extents to return info for
69 xen_extent_t *extents; // pointer to space for list of extents
70 } vbd_info_t;
73 typedef struct block_io_op_st
74 {
75 unsigned long cmd;
76 union
77 {
78 /* no entry for BLOCK_IO_OP_SIGNAL */
79 /* no entry for BLOCK_IO_OP_RESET */
80 unsigned long ring_mfn;
81 vbd_create_t create_params;
82 vbd_add_t add_params;
83 vbd_remove_t remove_params;
84 vbd_delete_t delete_params;
85 vbd_probe_t probe_params;
86 vbd_info_t info_params;
87 }
88 u;
89 } block_io_op_t;
94 #endif /* __HYP_IFS_VBD_H__ */