1 #ifndef _LINUX_VIRTUAL_H
2 #define _LINUX_VIRTUAL_H
4 #define VC_CATEGORY(c) (((c) >> 24) & 0x3F)
5 #define VC_COMMAND(c) (((c) >> 16) & 0xFF)
6 #define VC_VERSION(c) ((c) & 0xFFF)
8 #define VC_CMD(c,i,v) ((((VC_CAT_ ## c) & 0x3F) << 24) \
9 | (((i) & 0xFF) << 16) | ((v) & 0xFFF))
15 |VERSION|CREATE |MODIFY |MIGRATE|CONTROL|EXPERIM| |SPECIAL|SPECIAL|
16 |STATS |DESTROY|ALTER |CHANGE |LIMIT |TEST | | | |
17 |INFO |SETUP | |MOVE | | | | | |
18 -------+-------+-------+-------+-------+-------+-------+ +-------+-------+
19 SYSTEM |VERSION| | | | | | |DEVICES| |
20 HOST | 00| 01| 02| 03| 04| 05| | 06| 07|
21 -------+-------+-------+-------+-------+-------+-------+ +-------+-------+
22 CPU | | | | | | | |SCHED. | |
23 PROCESS| 08| 09| 10| 11| 12| 13| | 14| 15|
24 -------+-------+-------+-------+-------+-------+-------+ +-------+-------+
25 MEMORY | | | | | | | |SWAP | |
26 | 16| 17| 18| 19| 20| 21| | 22| 23|
27 -------+-------+-------+-------+-------+-------+-------+ +-------+-------+
28 NETWORK| | | | | | | |SERIAL | |
29 | 24| 25| 26| 27| 28| 29| | 30| 31|
30 -------+-------+-------+-------+-------+-------+-------+ +-------+-------+
31 DISK | | | | | | | | | |
32 VFS | 32| 33| 34| 35| 36| 37| | 38| 39|
33 -------+-------+-------+-------+-------+-------+-------+ +-------+-------+
34 OTHER | | | | | | | | | |
35 | 40| 41| 42| 43| 44| 45| | 46| 47|
36 =======+=======+=======+=======+=======+=======+=======+ +=======+=======+
37 SPECIAL| | | | | | | | | |
38 | 48| 49| 50| 51| 52| 53| | 54| 55|
39 -------+-------+-------+-------+-------+-------+-------+ +-------+-------+
40 SPECIAL| | | | |RLIMIT |SYSCALL| | |COMPAT |
41 | 56| 57| 58| 59| 60|TEST 61| | 62| 63|
42 -------+-------+-------+-------+-------+-------+-------+ +-------+-------+
46 #define VC_CAT_VERSION 0
48 #define VC_CAT_PROCTRL 12
50 #define VC_CAT_RLIMIT 60
52 #define VC_CAT_SYSTEST 61
53 #define VC_CAT_COMPAT 63
55 /* interface version */
57 #define VCI_VERSION 0x00010001
63 #define VCMD_get_version VC_CMD(VERSION, 0, 0)
66 /* compatibiliy vserver commands */
68 #define VCMD_new_s_context VC_CMD(COMPAT, 1, 1)
69 #define VCMD_set_ipv4root VC_CMD(COMPAT, 2, 3)
71 /* compatibiliy vserver arguments */
73 struct vcmd_new_s_context_v1 {
78 #define NB_IPV4ROOT 16
80 struct vcmd_set_ipv4root_v3 {
81 /* number of pairs in id */
86 } ip_mask_pair[NB_IPV4ROOT];
89 /* context signalling */
91 #define VCMD_ctx_kill VC_CMD(PROCTRL, 1, 0)
93 struct vcmd_ctx_kill_v0 {
98 /* rlimit vserver commands */
100 #define VCMD_get_rlimit VC_CMD(RLIMIT, 1, 0)
101 #define VCMD_set_rlimit VC_CMD(RLIMIT, 2, 0)
102 #define VCMD_get_rlimit_mask VC_CMD(RLIMIT, 3, 0)
104 struct vcmd_ctx_rlimit_v0 {
111 struct vcmd_ctx_rlimit_mask_v0 {
117 #define CRLIM_INFINITY (~0ULL)
118 #define CRLIM_KEEP (~1ULL)
121 #endif /* _LINUX_VIRTUAL_H */