Skip to content

Commit

Permalink
cgroups: remove freezer_state()
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
  • Loading branch information
Christian Brauner committed May 19, 2018
1 parent 2202afc commit dd66700
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 27 deletions.
21 changes: 0 additions & 21 deletions src/lxc/freezer.c
Expand Up @@ -42,27 +42,6 @@

lxc_log_define(lxc_freezer, lxc);

lxc_state_t freezer_state(const char *name, const char *lxcpath)
{
int ret;
char v[100];
struct cgroup_ops *cgroup_ops;

cgroup_ops = cgroup_init(NULL);
if (!cgroup_ops)
return -1;

ret = cgroup_ops->get(cgroup_ops, "freezer.state", v, sizeof(v), name, lxcpath);
cgroup_exit(cgroup_ops);
if (ret < 0)
return -1;

v[99] = '\0';
v[lxc_char_right_gc(v, strlen(v))] = '\0';

return lxc_str2state(v);
}

static int do_freeze_thaw(bool freeze, const char *name, const char *lxcpath)
{
int ret;
Expand Down
7 changes: 1 addition & 6 deletions src/lxc/state.c
Expand Up @@ -72,12 +72,7 @@ lxc_state_t lxc_str2state(const char *state)

lxc_state_t lxc_getstate(const char *name, const char *lxcpath)
{
extern lxc_state_t freezer_state(const char *name, const char *lxcpath);

lxc_state_t state = freezer_state(name, lxcpath);
if (state != FROZEN && state != FREEZING)
state = lxc_cmd_get_state(name, lxcpath);
return state;
return lxc_cmd_get_state(name, lxcpath);
}

static int fillwaitedstates(const char *strstates, lxc_state_t *states)
Expand Down

0 comments on commit dd66700

Please sign in to comment.