ia64/xen-unstable

view xen/include/xeno/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 352a82eb57ad 4aba3a48d64f
children 7272f4d3fafe
line source
1 /*
2 ** include/xeno/vbd.h:
3 ** -- xen internal declarations + prototypes for virtual block devices
4 **
5 */
6 #ifndef __VBD_H__
7 #define __VBD_H__
9 #include <hypervisor-ifs/block.h>
10 #include <hypervisor-ifs/vbd.h>
12 /* an entry in a list of xen_extent's */
13 typedef struct _xen_extent_le {
14 xen_extent_t extent; // an individual extent
15 struct _xen_extent_le *next; // and a pointer to the next
16 } xen_extent_le_t;
19 /*
20 ** This is what a vbd looks like from the pov of xen: essentially a list
21 ** of xen_extents which a given domain refers to by a particular 16bit id.
22 ** Each domain has a hash table to map from these to the relevant VBD.
23 */
24 typedef struct _vbd {
25 unsigned short vdevice; // what the domain refers to this vbd as
26 unsigned short mode; // VBD_MODE_{READONLY,READWRITE}
27 xen_extent_le_t *extents; // list of xen_extents making up this vbd
28 struct _vbd *next; // for chaining in the hash table
29 } vbd_t;
31 #define VBD_HTAB_SZ 16 // no. of entries in the vbd hash table.
33 long vbd_create(vbd_create_t *create_params);
34 long vbd_add(vbd_add_t *add_params);
35 long vbd_remove(vbd_remove_t *remove_params);
36 long vbd_delete(vbd_delete_t *delete_params);
37 long vbd_probe(vbd_probe_t *probe_params);
38 long vbd_info(vbd_info_t *info_params);
41 /* Describes a [partial] disk extent (part of a block io request) */
42 typedef struct {
43 unsigned short dev;
44 unsigned short nr_sects;
45 unsigned long sector_number;
46 unsigned long buffer;
47 } phys_seg_t;
50 int vbd_translate(phys_seg_t * pseg, int *nr_segs,
51 struct task_struct *p, int operation);
54 #endif /* __VBD_H__ */