}
/* Connects to command socket therefore isn't callable from command handler. */
-int cgroup_get(struct lxc_conf *conf,
- const char *name, const char *lxcpath,
+int cgroup_get(const char *name, const char *lxcpath,
const char *filename, char *buf, size_t len)
{
__do_close int unified_fd = -EBADF;
ssize_t ret;
- if (!conf || is_empty_string(filename) || is_empty_string(name) ||
+ if (is_empty_string(filename) || is_empty_string(name) ||
is_empty_string(lxcpath))
return ret_errno(EINVAL);
}
/* Connects to command socket therefore isn't callable from command handler. */
-int cgroup_set(struct lxc_conf *conf, const char *name, const char *lxcpath,
+int cgroup_set(const char *name, const char *lxcpath,
const char *filename, const char *value)
{
__do_close int unified_fd = -EBADF;
ssize_t ret;
- if (!conf || is_empty_string(filename) || is_empty_string(value) ||
+ if (is_empty_string(filename) || is_empty_string(value) ||
is_empty_string(name) || is_empty_string(lxcpath))
return ret_errno(EINVAL);
return log_trace(0, "Container now %s", (state_num == 1) ? "frozen" : "unfrozen");
}
-bool cgroup_freeze(struct lxc_conf *conf, const char *name, const char *lxcpath, int timeout)
+bool cgroup_freeze(const char *name, const char *lxcpath, int timeout)
{
__do_close int unified_fd = -EBADF;
int ret;
return ret == 0;
}
-bool cgroup_unfreeze(struct lxc_conf *conf, const char *name, const char *lxcpath, int timeout)
+bool cgroup_unfreeze(const char *name, const char *lxcpath, int timeout)
{
__do_close int unified_fd = -EBADF;
int ret;
__hidden extern int cgroup_attach(const struct lxc_conf *conf, const char *name,
const char *lxcpath, pid_t pid);
-__hidden extern int cgroup_get(struct lxc_conf *conf, const char *name,
- const char *lxcpath, const char *filename,
- char *buf, size_t len);
-__hidden extern int cgroup_set(struct lxc_conf *conf, const char *name,
- const char *lxcpath, const char *filename,
- const char *value);
-__hidden extern bool cgroup_freeze(struct lxc_conf *conf, const char *name,
- const char *lxcpath, int timeout);
-__hidden extern bool cgroup_unfreeze(struct lxc_conf *conf, const char *name,
- const char *lxcpath, int timeout);
+__hidden extern int cgroup_get(const char *name, const char *lxcpath,
+ const char *filename, char *buf, size_t len);
+__hidden extern int cgroup_set(const char *name, const char *lxcpath,
+ const char *filename, const char *value);
+__hidden extern bool cgroup_freeze(const char *name, const char *lxcpath, int timeout);
+__hidden extern bool cgroup_unfreeze(const char *name, const char *lxcpath, int timeout);
static inline bool pure_unified_layout(const struct cgroup_ops *ops)
{
s = lxc_getstate(c->name, c->config_path);
if (s != FROZEN) {
- bret = cgroup_freeze(c->lxc_conf, c->name, c->config_path, -1);
+ bret = cgroup_freeze(c->name, c->config_path, -1);
if (!bret && errno == ENOCGROUP2)
bret = lxc_freeze(c->lxc_conf, c->name, c->config_path);
}
s = lxc_getstate(c->name, c->config_path);
if (s == FROZEN) {
- bret = cgroup_unfreeze(c->lxc_conf, c->name, c->config_path, -1);
+ bret = cgroup_unfreeze(c->name, c->config_path, -1);
if (!bret && errno == ENOCGROUP2)
bret = lxc_unfreeze(c->lxc_conf, c->name, c->config_path);
}
if (is_stopped(c))
return false;
- ret = cgroup_set(c->lxc_conf, c->name, c->config_path, subsys, value);
+ ret = cgroup_set(c->name, c->config_path, subsys, value);
if (ret == ENOCGROUP2) {
cgroup_ops = cgroup_init(c->lxc_conf);
if (!cgroup_ops)
if (is_stopped(c))
return -1;
- ret = cgroup_get(c->lxc_conf, c->name, c->config_path, subsys, retv, inlen);
+ ret = cgroup_get(c->name, c->config_path, subsys, retv, inlen);
if (ret == ENOCGROUP2) {
cgroup_ops = cgroup_init(c->lxc_conf);
if (!cgroup_ops)