~ubuntu-branches/ubuntu/utopic/xen/utopic

« back to all changes in this revision

Viewing changes to tools/xc/lib/xc.h

  • Committer: Bazaar Package Importer
  • Author(s): Bastian Blank
  • Date: 2010-05-06 15:47:38 UTC
  • mto: (1.3.1) (15.1.1 sid) (4.1.1 experimental)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20100506154738-agoz0rlafrh1fnq7
Tags: upstream-4.0.0
ImportĀ upstreamĀ versionĀ 4.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/******************************************************************************
2
 
 * xc.h
3
 
 * 
4
 
 * A library for low-level access to the Xen control interfaces.
5
 
 * 
6
 
 * Copyright (c) 2003, K A Fraser.
7
 
 */
8
 
 
9
 
#ifndef __XC_H__
10
 
#define __XC_H__
11
 
 
12
 
typedef unsigned char      u8;
13
 
typedef unsigned short     u16;
14
 
typedef unsigned long      u32;
15
 
typedef unsigned long long u64;
16
 
typedef signed char        s8;
17
 
typedef signed short       s16;
18
 
typedef signed long        s32;
19
 
typedef signed long long   s64;
20
 
 
21
 
/* Obtain or relinquish a handle on the 'xc' library. */
22
 
int xc_interface_open(void);
23
 
int xc_interface_close(int xc_handle);
24
 
 
25
 
typedef struct {
26
 
    u64           domid;
27
 
    unsigned int  cpu;
28
 
    int           has_cpu;
29
 
    int           stopped;
30
 
    unsigned long nr_pages;
31
 
    u64           cpu_time;
32
 
#define XC_DOMINFO_MAXNAME 16
33
 
    char          name[XC_DOMINFO_MAXNAME];
34
 
} xc_dominfo_t;
35
 
 
36
 
int xc_domain_create(int xc_handle, 
37
 
                     unsigned int mem_kb, 
38
 
                     const char *name,
39
 
                     u64 *pdomid);
40
 
int xc_domain_start(int xc_handle, 
41
 
                    u64 domid);
42
 
int xc_domain_stop(int xc_handle, 
43
 
                   u64 domid);
44
 
int xc_domain_destroy(int xc_handle, 
45
 
                      u64 domid, 
46
 
                      int force);
47
 
int xc_domain_pincpu(int xc_handle,
48
 
                     u64 domid,
49
 
                     int cpu);
50
 
int xc_domain_getinfo(int xc_handle,
51
 
                      u64 first_domid, 
52
 
                      unsigned int max_doms,
53
 
                      xc_dominfo_t *info);
54
 
 
55
 
int xc_linux_save(int xc_handle,
56
 
                  u64 domid, 
57
 
                  const char *state_file, 
58
 
                  int verbose);
59
 
int xc_linux_restore(int xc_handle,
60
 
                     const char *state_file, 
61
 
                     int verbose,
62
 
                     u64 *pdomid);
63
 
int xc_linux_build(int xc_handle,
64
 
                   u64 domid,
65
 
                   const char *image_name,
66
 
                   const char *ramdisk_name,
67
 
                   const char *cmdline);
68
 
 
69
 
int xc_netbsd_build(int xc_handle,
70
 
                    u64 domid,
71
 
                    const char *image_name,
72
 
                    const char *cmdline);
73
 
 
74
 
int xc_bvtsched_global_set(int xc_handle,
75
 
                           unsigned long ctx_allow);
76
 
int xc_bvtsched_domain_set(int xc_handle,
77
 
                           u64 domid,
78
 
                           unsigned long mcuadv,
79
 
                           unsigned long warp,
80
 
                           unsigned long warpl,
81
 
                           unsigned long warpu);
82
 
 
83
 
typedef struct {
84
 
    unsigned long credit_bytes;
85
 
    unsigned long credit_usec;
86
 
} xc_vif_sched_params_t;
87
 
 
88
 
typedef struct {
89
 
    u64 tx_bytes, tx_pkts;
90
 
    u64 rx_bytes, rx_pkts;
91
 
} xc_vif_stats_t;
92
 
 
93
 
int xc_vif_scheduler_set(int xc_handle,
94
 
                         u64 domid, 
95
 
                         unsigned int vifid,
96
 
                         xc_vif_sched_params_t *params);
97
 
int xc_vif_scheduler_get(int xc_handle,
98
 
                         u64 domid, 
99
 
                         unsigned int vifid,
100
 
                         xc_vif_sched_params_t *params);
101
 
int xc_vif_stats_get(int xc_handle,
102
 
                     u64 domid, 
103
 
                     unsigned int vifid,
104
 
                     xc_vif_stats_t *stats);
105
 
 
106
 
typedef struct {
107
 
#define XC_VBDDOM_PROBE_ALL (~0ULL)
108
 
    u64            domid;
109
 
    unsigned short vbdid;
110
 
#define XC_VBDF_WRITEABLE (1<<0)
111
 
    unsigned long  flags;
112
 
    u64            nr_sectors;
113
 
} xc_vbd_t;
114
 
 
115
 
typedef struct {
116
 
    unsigned short real_device;
117
 
    u64            start_sector;
118
 
    u64            nr_sectors;
119
 
} xc_vbdextent_t;
120
 
 
121
 
int xc_vbd_create(int xc_handle,
122
 
                  u64 domid, 
123
 
                  unsigned short vbdid, 
124
 
                  int writeable);
125
 
int xc_vbd_destroy(int xc_handle,
126
 
                   u64 domid, 
127
 
                   unsigned short vbdid);
128
 
int xc_vbd_grow(int xc_handle,
129
 
                u64 domid, 
130
 
                unsigned short vbdid,
131
 
                xc_vbdextent_t *extent);
132
 
int xc_vbd_shrink(int xc_handle,
133
 
                  u64 domid, 
134
 
                  unsigned short vbdid);
135
 
int xc_vbd_setextents(int xc_handle,
136
 
                      u64 domid, 
137
 
                      unsigned short vbdid,
138
 
                      unsigned int nr_extents,
139
 
                      xc_vbdextent_t *extents);
140
 
int xc_vbd_getextents(int xc_handle,
141
 
                      u64 domid, 
142
 
                      unsigned short vbdid,
143
 
                      unsigned int max_extents,
144
 
                      xc_vbdextent_t *extents,
145
 
                      int *writeable);
146
 
int xc_vbd_probe(int xc_handle,
147
 
                 u64 domid,
148
 
                 unsigned int max_vbds,
149
 
                 xc_vbd_t *vbds);
150
 
 
151
 
int xc_readconsolering(int xc_handle,
152
 
                       char *str, 
153
 
                       unsigned int max_chars, 
154
 
                       int clear);
155
 
 
156
 
 
157
 
#endif /* __XC_H__ */