mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-08-06 12:18:35 +00:00
stop config reading if cgroup setting failed
in today's code lxc-start to not stop if setup_cgroup is detecting an error Signed-off-by: Michel Normand <michel_mno@laposte.net> Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
This commit is contained in:
parent
1846e71a27
commit
88329c69cd
@ -457,6 +457,7 @@ static int setup_cgroup(const char *name, struct lxc_list *cgroups)
|
|||||||
{
|
{
|
||||||
struct lxc_list *iterator;
|
struct lxc_list *iterator;
|
||||||
struct lxc_cgroup *cg;
|
struct lxc_cgroup *cg;
|
||||||
|
int ret = -1;
|
||||||
|
|
||||||
if (lxc_list_empty(cgroups))
|
if (lxc_list_empty(cgroups))
|
||||||
return 0;
|
return 0;
|
||||||
@ -466,14 +467,15 @@ static int setup_cgroup(const char *name, struct lxc_list *cgroups)
|
|||||||
cg = iterator->elem;
|
cg = iterator->elem;
|
||||||
|
|
||||||
if (lxc_cgroup_set(name, cg->subsystem, cg->value))
|
if (lxc_cgroup_set(name, cg->subsystem, cg->value))
|
||||||
break;
|
goto out;
|
||||||
|
|
||||||
DEBUG("cgroup '%s' set to '%s'", cg->subsystem, cg->value);
|
DEBUG("cgroup '%s' set to '%s'", cg->subsystem, cg->value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ret = 0;
|
||||||
INFO("cgroup has been setup");
|
INFO("cgroup has been setup");
|
||||||
|
out:
|
||||||
return 0;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void parse_mntopt(char *opt, unsigned long *flags, char **data)
|
static void parse_mntopt(char *opt, unsigned long *flags, char **data)
|
||||||
|
Loading…
Reference in New Issue
Block a user