Skip to content

Commit

Permalink
conf: remove unused variables
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 Oct 14, 2021
1 parent bbf41da commit 2e76a39
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 37 deletions.
30 changes: 0 additions & 30 deletions src/lxc/conf.c
Original file line number Diff line number Diff line change
Expand Up @@ -3390,8 +3390,6 @@ struct lxc_conf *lxc_conf_init(void)
INIT_LIST_HEAD(&new->id_map);
new->root_nsuid_map = NULL;
new->root_nsgid_map = NULL;
lxc_list_init(&new->includes);
lxc_list_init(&new->aliens);
lxc_list_init(&new->environment);
INIT_LIST_HEAD(&new->limits);
INIT_LIST_HEAD(&new->sysctls);
Expand Down Expand Up @@ -4743,32 +4741,6 @@ int lxc_clear_hooks(struct lxc_conf *c, const char *key)
return 0;
}

static inline void lxc_clear_aliens(struct lxc_conf *conf)
{
struct lxc_list *it, *next;

lxc_list_for_each_safe (it, &conf->aliens, next) {
lxc_list_del(it);
free(it->elem);
free(it);
}

lxc_list_init(&conf->aliens);
}

void lxc_clear_includes(struct lxc_conf *conf)
{
struct lxc_list *it, *next;

lxc_list_for_each_safe(it, &conf->includes, next) {
lxc_list_del(it);
free(it->elem);
free(it);
}

lxc_list_init(&conf->includes);
}

int lxc_clear_apparmor_raw(struct lxc_conf *c)
{
struct lxc_list *it, *next;
Expand Down Expand Up @@ -4824,8 +4796,6 @@ void lxc_conf_free(struct lxc_conf *conf)
lxc_clear_mount_entries(conf);
lxc_clear_idmaps(conf);
lxc_clear_groups(conf);
lxc_clear_includes(conf);
lxc_clear_aliens(conf);
lxc_clear_environment(conf);
lxc_clear_limits(conf, "lxc.prlimit");
lxc_clear_sysctls(conf, "lxc.sysctl");
Expand Down
6 changes: 0 additions & 6 deletions src/lxc/conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -436,11 +436,6 @@ struct lxc_conf {
unsigned int monitor_unshare;
unsigned int monitor_signal_pdeath;

/* list of included files */
struct lxc_list includes;
/* config entries which are not "lxc.*" are aliens */
struct lxc_list aliens;

/* list of environment variables we'll add to the container when
* started */
struct lxc_list environment;
Expand Down Expand Up @@ -540,7 +535,6 @@ __hidden extern int lxc_clear_environment(struct lxc_conf *c);
__hidden extern int lxc_clear_limits(struct lxc_conf *c, const char *key);
__hidden extern int lxc_delete_autodev(struct lxc_handler *handler);
__hidden extern int lxc_clear_autodev_tmpfs_size(struct lxc_conf *c);
__hidden extern void lxc_clear_includes(struct lxc_conf *conf);
__hidden extern int lxc_setup_rootfs_prepare_root(struct lxc_conf *conf, const char *name,
const char *lxcpath);
__hidden extern int lxc_setup(struct lxc_handler *handler);
Expand Down
1 change: 0 additions & 1 deletion src/lxc/confile.c
Original file line number Diff line number Diff line change
Expand Up @@ -4907,7 +4907,6 @@ static inline int clr_config_proc(const char *key, struct lxc_conf *c,
static inline int clr_config_includefiles(const char *key, struct lxc_conf *c,
void *data)
{
lxc_clear_includes(c);
return 0;
}

Expand Down

0 comments on commit 2e76a39

Please sign in to comment.