/lxc/src/lxc/ |
H A D | freezer.c | 42 lxc_state_t freezer_state(const char *name, const char *lxcpath) argument 45 if (lxc_cgroup_get("freezer.state", v, 100, name, lxcpath) < 0) 53 static int do_freeze_thaw(int freeze, const char *name, const char *lxcpath) argument 58 if (lxc_cgroup_set("freezer.state", state, name, lxcpath) < 0) { 59 ERROR("Failed to freeze %s:%s", lxcpath, name); 63 if (lxc_cgroup_get("freezer.state", v, 100, name, lxcpath) < 0) { 64 ERROR("Failed to get new freezer state for %s:%s", lxcpath, name); 71 lxc_monitor_send_state(name, freeze ? FROZEN : THAWED, lxcpath); 78 int lxc_freeze(const char *name, const char *lxcpath) argument 80 lxc_monitor_send_state(name, FREEZING, lxcpath); 84 lxc_unfreeze(const char *name, const char *lxcpath) argument [all...] |
H A D | lxc.h | 55 const char *lxcpath, bool backgrounded); 67 struct lxc_conf *conf, const char *lxcpath, 82 extern int lxc_freeze(const char *name, const char *lxcpath); 89 extern int lxc_unfreeze(const char *name, const char *lxcpath); 96 extern lxc_state_t lxc_state(const char *name, const char *lxcpath); 104 * @lxcpath : lxc config path for container 107 extern int lxc_cgroup_set(const char *filename, const char *value, const char *name, const char *lxcpath); 116 * @lxcpath : lxc config path for container 119 extern int lxc_cgroup_get(const char *filename, char *value, size_t len, const char *name, const char *lxcpath);
|
H A D | commands.h | 71 extern int lxc_cmd_console_winch(const char *name, const char *lxcpath); 73 const char *lxcpath); 78 extern char *lxc_cmd_get_cgroup_path(const char *name, const char *lxcpath, 80 extern int lxc_cmd_get_clone_flags(const char *name, const char *lxcpath); 81 extern char *lxc_cmd_get_config_item(const char *name, const char *item, const char *lxcpath); 84 extern pid_t lxc_cmd_get_init_pid(const char *name, const char *lxcpath); 85 extern lxc_state_t lxc_cmd_get_state(const char *name, const char *lxcpath); 86 extern int lxc_cmd_stop(const char *name, const char *lxcpath); 92 const char *lxcpath); 95 extern int lxc_try_cmd(const char *name, const char *lxcpath); [all...] |
H A D | monitor.h | 45 extern int lxc_monitor_sock_name(const char *lxcpath, struct sockaddr_un *addr); 46 extern int lxc_monitor_fifo_name(const char *lxcpath, char *fifo_path, 49 const char *lxcpath); 51 const char *lxcpath); 52 extern int lxc_monitord_spawn(const char *lxcpath); 59 extern int lxc_monitor_open(const char *lxcpath);
|
H A D | state.h | 32 extern lxc_state_t lxc_getstate(const char *name, const char *lxcpath); 36 extern int lxc_wait(const char *lxcname, const char *states, int timeout, const char *lxcpath);
|
H A D | monitor.c | 55 int lxc_monitor_fifo_name(const char *lxcpath, char *fifo_path, size_t fifo_path_sz, argument 66 ret = snprintf(fifo_path, fifo_path_sz, "%s/lxc/%s", rundir, lxcpath); 68 ERROR("rundir/lxcpath (%s/%s) too long for monitor fifo.", rundir, lxcpath); 79 ret = snprintf(fifo_path, fifo_path_sz, "%s/lxc/%s/monitor-fifo", rundir, lxcpath); 81 ERROR("rundir/lxcpath (%s/%s) too long for monitor fifo.", rundir, lxcpath); 89 static void lxc_monitor_fifo_send(struct lxc_msg *msg, const char *lxcpath) argument 96 ret = lxc_monitor_fifo_name(lxcpath, fifo_path, sizeof(fifo_path), 0); 131 const char *lxcpath) 130 lxc_monitor_send_state(const char *name, lxc_state_t state, const char *lxcpath) argument 140 lxc_monitor_send_exit_code(const char *name, int exit_code, const char *lxcpath) argument 165 lxc_monitor_sock_name(const char *lxcpath, struct sockaddr_un *addr) argument 206 lxc_monitor_open(const char *lxcpath) argument 308 lxc_monitord_spawn(const char *lxcpath) argument [all...] |
H A D | state.c | 72 lxc_state_t lxc_getstate(const char *name, const char *lxcpath) argument 74 extern lxc_state_t freezer_state(const char *name, const char *lxcpath); 76 lxc_state_t state = freezer_state(name, lxcpath); 78 state = lxc_cmd_get_state(name, lxcpath); 109 const char *lxcpath) 118 if (lxc_monitord_spawn(lxcpath)) 121 fd = lxc_monitor_open(lxcpath); 130 state = lxc_getstate(lxcname, lxcpath); 108 lxc_wait(const char *lxcname, const char *states, int timeout, const char *lxcpath) argument
|
H A D | attach.h | 39 extern int lxc_attach(const char* name, const char* lxcpath, lxc_attach_exec_t exec_function, void* exec_payload, lxc_attach_options_t* options, pid_t* attached_process);
|
H A D | commands.c | 78 const char *lxcpath, const char *hashed_sock_name) 99 if (!lxcpath) { 100 lxcpath = lxc_global_config_value("lxc.lxcpath"); 101 if (!lxcpath) { 102 ERROR("Out of memory getting lxcpath"); 107 ret = snprintf(path, len, "%s/%s/command", lxcpath, name); 115 /* ret >= len; lxcpath or name is too long. hash both */ 116 tmplen = strlen(name) + strlen(lxcpath) + 2; 118 ret = snprintf(tmppath, tmplen, "%s/%s", lxcpath, nam 77 fill_sock_name(char *path, int len, const char *lxcname, const char *lxcpath, const char *hashed_sock_name) argument 279 lxc_cmd(const char *name, struct lxc_cmd_rr *cmd, int *stopped, const char *lxcpath, const char *hashed_sock_name) argument 348 lxc_try_cmd(const char *name, const char *lxcpath) argument 388 lxc_cmd_get_init_pid(const char *name, const char *lxcpath) argument 418 lxc_cmd_get_clone_flags(const char *name, const char *lxcpath) argument 452 lxc_cmd_get_cgroup_path(const char *name, const char *lxcpath, const char *subsystem) argument 511 lxc_cmd_get_config_item(const char *name, const char *item, const char *lxcpath) argument 566 lxc_cmd_get_state(const char *name, const char *lxcpath) argument 607 lxc_cmd_stop(const char *name, const char *lxcpath) argument 669 lxc_cmd_console_winch(const char *name, const char *lxcpath) argument 703 lxc_cmd_console(const char *name, int *ttynum, int *fd, const char *lxcpath) argument 980 lxc_cmd_init(const char *name, struct lxc_handler *handler, const char *lxcpath) argument [all...] |
H A D | log.c | 323 * @lxcpath : the lxcpath to use as a basename or NULL to use LOGPATH 326 static char *build_log_path(const char *name, const char *lxcpath) argument 341 * If USE_CONFIGPATH_LOGS is true or lxcpath is given, the resulting 349 if (lxcpath) 352 lxcpath = LOGPATH; 355 len += strlen(lxcpath) + 1 + strlen(name) + 1; /* add "/$container_name/" */ 357 len += strlen(lxcpath) + 1; 363 ret = snprintf(p, len, "%s/%s/%s.log", lxcpath, name, name); 365 ret = snprintf(p, len, "%s/%s.log", lxcpath, nam 426 _lxc_log_set_file(const char *name, const char *lxcpath, int create_dirs) argument 446 lxc_log_init(const char *name, const char *file, const char *priority, const char *prefix, int quiet, const char *lxcpath) argument [all...] |
H A D | lxc_monitord.c | 58 * @lxcpath : the path being monitored 67 const char *lxcpath; member in struct:lxc_monitor 85 ret = lxc_monitor_fifo_name(mon->lxcpath, fifo_path, sizeof(fifo_path), 1); 108 DEBUG("lxc-monitord already running on lxcpath %s.", mon->lxcpath); 120 ret = lxc_monitor_fifo_name(mon->lxcpath, fifo_path, sizeof(fifo_path), 0); 236 if (lxc_monitor_sock_name(mon->lxcpath, &addr) < 0) 253 if (lxc_monitor_sock_name(mon->lxcpath, &addr) < 0) 350 char *lxcpath = argv[1]; local 356 "Usage: lxc-monitord lxcpath syn [all...] |
/lxc/src/tests/ |
H A D | lxc-test-symlink | 16 lxcpath=/var/lib/lxcsym1 19 lxc-destroy -P $lxcpath -f -n symtest1 || true 20 rm -f $lxcpath 32 lxc-start -P $lxcpath -n symtest1 -l trace -o $lxcpath/log || pass="fail" 33 [ $pass = "pass" ] && lxc-wait -P $lxcpath -n symtest1 -t 10 -s RUNNING || pass="fail" 36 cat $lxcpath/log 40 lxc-stop -P $lxcpath -n symtest1 -k || true 43 # make lxcpath a symlink - this should NOT cause failure 44 ln -s /var/lib/lxc $lxcpath [all...] |
H A D | list.c | 25 static void test_list_func(const char *lxcpath, const char *type, argument 34 n = func(lxcpath, NULL, NULL); 37 n2 = func(lxcpath, NULL, &clist); 51 n2 = func(lxcpath, &names, NULL); 64 n2 = func(lxcpath, &names, &clist); 83 const char *lxcpath = NULL; local 86 lxcpath = argv[1]; 88 test_list_func(lxcpath, "Defined:", list_defined_containers); 89 test_list_func(lxcpath, "Active:", list_active_containers); 90 test_list_func(lxcpath, "Al [all...] |
H A D | may_control.c | 26 printf("Usage: %s name [lxcpath]\n", me); 32 const char *lxcpath = NULL, *name; local 40 lxcpath = argv[2]; 41 c = lxc_container_new(name, lxcpath);
|
H A D | cgpath.c | 48 static int test_running_container(const char *lxcpath, argument 59 if ((c = lxc_container_new(name, lxcpath)) == NULL) { 121 static int test_container(const char *lxcpath, argument 128 if (lxcpath) { 129 ret = mkdir(lxcpath, 0755); 131 TSTERR("failed to mkdir %s %s", lxcpath, strerror(errno)); 137 if ((c = lxc_container_new(name, lxcpath)) == NULL) { 144 c = lxc_container_new(name, lxcpath); 158 ret = test_running_container(lxcpath, group, name);
|
/lxc/src/lxc/tools/ |
H A D | lxc_unfreeze.c | 66 my_args.progname, my_args.quiet, my_args.lxcpath[0])) 70 c = lxc_container_new(my_args.name, my_args.lxcpath[0]); 72 ERROR("No such container: %s:%s", my_args.lxcpath[0], my_args.name); 77 ERROR("Insufficent privileges to control %s:%s", my_args.lxcpath[0], my_args.name); 98 ERROR("Failed to unfreeze %s:%s", my_args.lxcpath[0], my_args.name);
|
H A D | lxc_freeze.c | 68 my_args.progname, my_args.quiet, my_args.lxcpath[0])) 72 c = lxc_container_new(my_args.name, my_args.lxcpath[0]); 74 ERROR("No such container: %s:%s", my_args.lxcpath[0], my_args.name); 94 ERROR("Insufficent privileges to control %s:%s", my_args.lxcpath[0], my_args.name); 100 ERROR("Failed to freeze %s:%s", my_args.lxcpath[0], my_args.name);
|
H A D | lxc_cgroup.c | 78 my_args.progname, my_args.quiet, my_args.lxcpath[0])) 84 c = lxc_container_new(my_args.name, my_args.lxcpath[0]); 104 ERROR("Insufficent privileges to control %s:%s", my_args.lxcpath[0], my_args.name); 110 ERROR("'%s:%s' is not running", my_args.lxcpath[0], my_args.name); 128 state_object, my_args.lxcpath[0], my_args.name);
|
H A D | lxc_start.c | 96 static int pid_from_lxcname(const char *lxcname_or_pid, const char *lxcpath) { argument 101 s = lxc_container_new(lxcname_or_pid, lxcpath); 230 my_args.progname, my_args.quiet, my_args.lxcpath[0])) 234 if (access(my_args.lxcpath[0], O_RDONLY) < 0) { 236 fprintf(stderr, "You lack access to %s\n", my_args.lxcpath[0]); 240 const char *lxcpath = my_args.lxcpath[0]; local 245 * 2. rcfile not specified, use $lxcpath/$lxcname/config 251 c = lxc_container_new(my_args.name, lxcpath); 270 rc = asprintf(&rcfile, "%s/%s/config", lxcpath, my_arg [all...] |
/lxc/src/lxc/bdev/ |
H A D | lxczfs.h | 44 const char *nname, const char *lxcpath, int snapshot); 46 const char *cname, const char *oldpath, const char *lxcpath,
|
H A D | lxcdir.h | 43 const char *cname, const char *oldpath, const char *lxcpath,
|
H A D | lxcloop.h | 43 const char *cname, const char *oldpath, const char *lxcpath,
|
H A D | lxcrbd.h | 43 const char *cname, const char *oldpath, const char *lxcpath,
|
/lxc/doc/ |
H A D | lxc.system.conf | 11 lxc.lxcpath = /var/lib/lxc/
|
/lxc/src/lxc/cgroups/ |
H A D | cgroup.h | 53 int (*set)(const char *filename, const char *value, const char *name, const char *lxcpath); 54 int (*get)(const char *filename, char *value, size_t len, const char *name, const char *lxcpath); 58 bool (*attach)(const char *name, const char *lxcpath, pid_t pid); 65 extern bool cgroup_attach(const char *name, const char *lxcpath, pid_t pid);
|