1 #ifndef _LINUX_VIRTUAL_H
2 #define _LINUX_VIRTUAL_H
8 #define VC_CATEGORY(c) (((c) >> 24) & 0x3F)
9 #define VC_COMMAND(c) (((c) >> 16) & 0xFF)
10 #define VC_VERSION(c) ((c) & 0xFFF)
12 #define VC_CMD(c,i,v) ((((VC_CAT_ ## c) & 0x3F) << 24) \
13 | (((i) & 0xFF) << 16) | ((v) & 0xFFF))
19 |VERSION|CREATE |MODIFY |MIGRATE|CONTROL|EXPERIM| |SPECIAL|SPECIAL|
20 |STATS |DESTROY|ALTER |CHANGE |LIMIT |TEST | | | |
21 |INFO |SETUP | |MOVE | | | | | |
22 -------+-------+-------+-------+-------+-------+-------+ +-------+-------+
23 SYSTEM |VERSION| | | | | | |DEVICES| |
24 HOST | 00| 01| 02| 03| 04| 05| | 06| 07|
25 -------+-------+-------+-------+-------+-------+-------+ +-------+-------+
26 CPU | | | | | | | |SCHED. | |
27 PROCESS| 08| 09| 10| 11| 12| 13| | 14| 15|
28 -------+-------+-------+-------+-------+-------+-------+ +-------+-------+
29 MEMORY | | | | | | | |SWAP | |
30 | 16| 17| 18| 19| 20| 21| | 22| 23|
31 -------+-------+-------+-------+-------+-------+-------+ +-------+-------+
32 NETWORK| | | | | | | |SERIAL | |
33 | 24| 25| 26| 27| 28| 29| | 30| 31|
34 -------+-------+-------+-------+-------+-------+-------+ +-------+-------+
35 DISK | | | | | | | | | |
36 VFS | 32| 33| 34| 35| 36| 37| | 38| 39|
37 -------+-------+-------+-------+-------+-------+-------+ +-------+-------+
38 OTHER | | | | | | | | | |
39 | 40| 41| 42| 43| 44| 45| | 46| 47|
40 =======+=======+=======+=======+=======+=======+=======+ +=======+=======+
41 SPECIAL| | | | | | | | | |
42 | 48| 49| 50| 51| 52| 53| | 54| 55|
43 -------+-------+-------+-------+-------+-------+-------+ +-------+-------+
44 SPECIAL| | | | |RLIMIT |SYSCALL| | |COMPAT |
45 | 56| 57| 58| 59| 60|TEST 61| | 62| 63|
46 -------+-------+-------+-------+-------+-------+-------+ +-------+-------+
50 #define VC_CAT_VERSION 0
52 #define VC_CAT_PROCTRL 12
54 #define VC_CAT_SCHED 14
55 #define VC_CAT_INODE 38
57 #define VC_CAT_VINFO 46
59 #define VC_CAT_RLIMIT 60
61 #define VC_CAT_SYSTEST 61
62 #define VC_CAT_COMPAT 63
64 /* interface version */
66 #define VCI_VERSION 0x00010004
72 #define VCMD_get_version VC_CMD(VERSION, 0, 0)
75 /* compatibiliy vserver commands */
77 #define VCMD_new_s_context VC_CMD(COMPAT, 1, 1)
78 #define VCMD_set_ipv4root VC_CMD(COMPAT, 2, 3)
80 /* compatibiliy vserver arguments */
82 struct vcmd_new_s_context_v1 {
87 struct vcmd_set_ipv4root_v3 {
88 /* number of pairs in id */
93 } ip_mask_pair[NB_IPV4ROOT];
96 /* context signalling */
98 #define VCMD_ctx_kill VC_CMD(PROCTRL, 1, 0)
100 struct vcmd_ctx_kill_v0 {
105 /* rlimit vserver commands */
107 #define VCMD_get_rlimit VC_CMD(RLIMIT, 1, 0)
108 #define VCMD_set_rlimit VC_CMD(RLIMIT, 2, 0)
109 #define VCMD_get_rlimit_mask VC_CMD(RLIMIT, 3, 0)
111 struct vcmd_ctx_rlimit_v0 {
118 struct vcmd_ctx_rlimit_mask_v0 {
124 #define CRLIM_INFINITY (~0ULL)
125 #define CRLIM_KEEP (~1ULL)
129 #define VC_CAT_SCHED 14
131 /* scheduler vserver commands */
133 #define VCMD_get_sched VC_CMD(SCHED, 1, 1)
134 #define VCMD_set_sched VC_CMD(SCHED, 2, 1)
137 /* Structure for context's TBF scheduling priorities */
139 struct vcmd_tbf_sched_v1 {
143 uint32_t bucket_size;
146 #define TBFS_PERIOD_AUTO (0ULL)
147 #define TBFS_KEEP_VALUE (~0ULL)
150 /* inode vserver commands */
152 #define VCMD_get_iattr VC_CMD(INODE, 1, 0)
153 #define VCMD_set_iattr VC_CMD(INODE, 2, 0)
155 struct vcmd_ctx_iattr_v0 {
162 #define IATTR_XID 0x01000000
164 #define IATTR_ADMIN 0x00000001
165 #define IATTR_WATCH 0x00000002
166 #define IATTR_HIDE 0x00000004
168 #define IATTR_BARRIER 0x00010000
169 #define IATTR_IUNLINK 0x00020000
175 #define VCMD_task_xid VC_CMD(VINFO, 1, 0)
176 #define VCMD_task_nid VC_CMD(VINFO, 2, 0)
178 #define VCMD_vx_info VC_CMD(VINFO, 5, 0)
179 #define VCMD_nx_info VC_CMD(VINFO, 6, 0)
181 struct vcmd_vx_info_v0 {
188 #endif /* _LINUX_VIRTUAL_H */