#ifndef _VX_CONTEXT_H #define _VX_CONTEXT_H #include #define MAX_S_CONTEXT 65535 /* Arbitrary limit */ #define MIN_D_CONTEXT 49152 /* dynamic contexts start here */ #define VX_DYNAMIC_ID (-1UL) /* id for dynamic context */ #include struct _vx_virt { int nr_threads; int nr_running; int max_threads; unsigned long total_forks; unsigned int bias_cswtch; long bias_jiffies; long bias_idle; struct new_utsname utsname; }; #include #include #include #include struct vx_info { struct list_head vx_list; /* linked list of contexts */ xid_t vx_id; /* context id */ atomic_t vx_refcount; /* refcount */ struct vx_info *vx_parent; /* parent context */ // struct proc_dir_entry *vx_procent; /* proc entry */ unsigned int vx_flags; /* VX_INFO_xxx */ struct namespace *vx_namespace; /* context namespace */ pid_t vx_initpid; /* PID of fake init process */ struct _vx_virt virt; /* virtual/bias stuff */ struct _vx_limit limit; /* vserver limits */ char vx_name[65]; /* vserver name */ }; extern spinlock_t vxlist_lock; extern struct list_head vx_infos; #define VX_ADMIN 0x0001 #define VX_WATCH 0x0002 #define VX_DUMMY 0x0008 #define VX_IDENT 0x0010 #define VX_EQUIV 0x0020 #define VX_PARENT 0x0040 #define VX_CHILD 0x0080 #define VX_ARG_MASK 0x00F0 #define VX_DYNAMIC 0x0100 #define VX_STATIC 0x0200 #define VX_ATR_MASK 0x0F00 void free_vx_info(struct vx_info *); extern struct vx_info *find_vx_info(int); extern struct vx_info *find_or_create_vx_info(int); #include /* vinfo commands */ #define VCMD_task_xid VC_CMD(VINFO, 1, 0) #define VCMD_task_nid VC_CMD(VINFO, 2, 0) extern int vc_task_xid(uint32_t, void *); #define VCMD_vx_info VC_CMD(VINFO, 5, 0) #define VCMD_nx_info VC_CMD(VINFO, 6, 0) struct vcmd_vx_info_v0 { uint32_t xid; uint32_t initpid; /* more to come */ }; extern int vc_vx_info(uint32_t, void *); /* virtual host info names */ #define VCMD_vx_set_vhi_name VC_CMD(VHOST, 1, 0) #define VCMD_vx_get_vhi_name VC_CMD(VHOST, 2, 0) extern int vc_set_vhi_name(uint32_t, void *); extern int vc_get_vhi_name(uint32_t, void *); struct vcmd_vx_vhi_name_v0 { uint32_t field; char name[65]; }; enum vx_vhi_name_field { VHIN_CONTEXT=0, VHIN_SYSNAME, VHIN_NODENAME, VHIN_RELEASE, VHIN_VERSION, VHIN_MACHINE, VHIN_DOMAINNAME, }; #define VCMD_enter_namespace VC_CMD(PROCALT, 1, 0) extern int vc_enter_namespace(uint32_t, void *); // EXPORT_SYMBOL_GPL(vxlist_lock); // EXPORT_SYMBOL_GPL(vx_infos); // EXPORT_SYMBOL_GPL(find_vx_info); #endif