confile: add clearer for lxc.hook{.*}

parent d31d0103
...@@ -149,6 +149,7 @@ static int clr_config_utsname(const char *, struct lxc_conf *); ...@@ -149,6 +149,7 @@ static int clr_config_utsname(const char *, struct lxc_conf *);
static int set_config_hooks(const char *, const char *, struct lxc_conf *lxc_conf); static int set_config_hooks(const char *, const char *, struct lxc_conf *lxc_conf);
static int get_config_hooks(const char *, char *, int, struct lxc_conf *); static int get_config_hooks(const char *, char *, int, struct lxc_conf *);
static int clr_config_hooks(const char *, struct lxc_conf *);
static int set_config_network(const char *, const char *, struct lxc_conf *); static int set_config_network(const char *, const char *, struct lxc_conf *);
static int get_config_network(const char *, char *, int, struct lxc_conf *); static int get_config_network(const char *, char *, int, struct lxc_conf *);
...@@ -255,16 +256,16 @@ static struct lxc_config_t config[] = { ...@@ -255,16 +256,16 @@ static struct lxc_config_t config[] = {
{ "lxc.rootfs", set_config_rootfs, get_config_rootfs, clr_config_rootfs, }, { "lxc.rootfs", set_config_rootfs, get_config_rootfs, clr_config_rootfs, },
{ "lxc.pivotdir", set_config_pivotdir, get_config_pivotdir, clr_config_pivotdir, }, { "lxc.pivotdir", set_config_pivotdir, get_config_pivotdir, clr_config_pivotdir, },
{ "lxc.utsname", set_config_utsname, get_config_utsname, clr_config_utsname, }, { "lxc.utsname", set_config_utsname, get_config_utsname, clr_config_utsname, },
{ "lxc.hook.pre-start", set_config_hooks, get_config_hooks, NULL }, { "lxc.hook.pre-start", set_config_hooks, get_config_hooks, clr_config_hooks, },
{ "lxc.hook.pre-mount", set_config_hooks, get_config_hooks, NULL }, { "lxc.hook.pre-mount", set_config_hooks, get_config_hooks, clr_config_hooks, },
{ "lxc.hook.mount", set_config_hooks, get_config_hooks, NULL }, { "lxc.hook.mount", set_config_hooks, get_config_hooks, clr_config_hooks, },
{ "lxc.hook.autodev", set_config_hooks, get_config_hooks, NULL }, { "lxc.hook.autodev", set_config_hooks, get_config_hooks, clr_config_hooks, },
{ "lxc.hook.start", set_config_hooks, get_config_hooks, NULL }, { "lxc.hook.start", set_config_hooks, get_config_hooks, clr_config_hooks, },
{ "lxc.hook.stop", set_config_hooks, get_config_hooks, NULL }, { "lxc.hook.stop", set_config_hooks, get_config_hooks, clr_config_hooks, },
{ "lxc.hook.post-stop", set_config_hooks, get_config_hooks, NULL }, { "lxc.hook.post-stop", set_config_hooks, get_config_hooks, clr_config_hooks, },
{ "lxc.hook.clone", set_config_hooks, get_config_hooks, NULL }, { "lxc.hook.clone", set_config_hooks, get_config_hooks, clr_config_hooks, },
{ "lxc.hook.destroy", set_config_hooks, get_config_hooks, NULL }, { "lxc.hook.destroy", set_config_hooks, get_config_hooks, clr_config_hooks, },
{ "lxc.hook", set_config_hooks, get_config_hooks, NULL }, { "lxc.hook", set_config_hooks, get_config_hooks, clr_config_hooks, },
{ "lxc.network.type", set_config_network_type, get_config_network_item, NULL }, { "lxc.network.type", set_config_network_type, get_config_network_item, NULL },
{ "lxc.network.flags", set_config_network_flags, get_config_network_item, NULL }, { "lxc.network.flags", set_config_network_flags, get_config_network_item, NULL },
{ "lxc.network.link", set_config_network_link, get_config_network_item, NULL }, { "lxc.network.link", set_config_network_link, get_config_network_item, NULL },
...@@ -2763,9 +2764,6 @@ int lxc_clear_config_item(struct lxc_conf *c, const char *key) ...@@ -2763,9 +2764,6 @@ int lxc_clear_config_item(struct lxc_conf *c, const char *key)
} else if (strcmp(key, "lxc.cap.keep") == 0) { } else if (strcmp(key, "lxc.cap.keep") == 0) {
ret = lxc_clear_config_keepcaps(c); ret = lxc_clear_config_keepcaps(c);
} else if (strncmp(key, "lxc.hook", 8) == 0) {
ret = lxc_clear_hooks(c, key);
} else if (strncmp(key, "lxc.group", 9) == 0) { } else if (strncmp(key, "lxc.group", 9) == 0) {
ret = lxc_clear_groups(c); ret = lxc_clear_groups(c);
...@@ -4163,3 +4161,9 @@ static inline int clr_config_utsname(const char *key, struct lxc_conf *c) ...@@ -4163,3 +4161,9 @@ static inline int clr_config_utsname(const char *key, struct lxc_conf *c)
c->utsname = NULL; c->utsname = NULL;
return 0; return 0;
} }
static inline int clr_config_hooks(const char *key, struct lxc_conf *c)
{
return lxc_clear_hooks(c, key);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment