extern int lxc_clear_cgroups(struct lxc_conf *c, const char *key);
extern int lxc_clear_mount_entries(struct lxc_conf *c);
extern int lxc_clear_hooks(struct lxc_conf *c, const char *key);
+extern int lxc_clear_idmaps(struct lxc_conf *c);
/*
* Configure the container from inside
struct lxc_netdev *netdev;
struct lxc_list *list;
+ if (!value || strlen(value) == 0)
+ return lxc_clear_config_network(lxc_conf);
+
netdev = malloc(sizeof(*netdev));
if (!netdev) {
SYSERROR("failed to allocate memory");
static int config_hook(const char *key, const char *value,
struct lxc_conf *lxc_conf)
{
- char *copy = strdup(value);
+ char *copy;
+
+ if (!value || strlen(value) == 0)
+ return lxc_clear_hooks(lxc_conf, key);
+
+ copy = strdup(value);
if (!copy) {
SYSERROR("failed to dup string '%s'", value);
return -1;
struct lxc_list *cglist = NULL;
struct lxc_cgroup *cgelem = NULL;
+ if (!value || strlen(value) == 0)
+ return lxc_clear_cgroups(lxc_conf, key);
+
subkey = strstr(key, token);
if (!subkey)
char type;
int ret;
+ if (!value || strlen(value) == 0)
+ return lxc_clear_idmaps(lxc_conf);
+
subkey = strstr(key, token);
if (!subkey)
char *mntelem;
struct lxc_list *mntlist;
+ if (!value || strlen(value) == 0)
+ return lxc_clear_mount_entries(lxc_conf);
+
subkey = strstr(key, token);
if (!subkey) {
int ret = -1;
if (!strlen(value))
- return -1;
+ return lxc_clear_config_keepcaps(lxc_conf);
keepcaps = strdup(value);
if (!keepcaps) {
int ret = -1;
if (!strlen(value))
- return -1;
+ return lxc_clear_config_caps(lxc_conf);
dropcaps = strdup(value);
if (!dropcaps) {