[Lxc-users] total RAM limit
Serge Hallyn
serge.hallyn at ubuntu.com
Wed Apr 24 13:55:42 UTC 2013
Quoting Frederic Crozat (fcrozat at suse.com):
> Le mardi 23 avril 2013 à 10:09 -0500, Serge Hallyn a écrit :
> > Quoting Frederic Crozat (fcrozat at suse.com):
>
> > Thanks - clearly my patch needed some love :) Just a few comments below.
>
> hehe :)
> >
> > > +
> > > + /* check if directory exists, and create it otherwise */
> > > + if (access(path, F_OK)) {
> > > + ret = mkdir(path, 0755);
> > > + if (ret == -1 && errno == EEXIST) {
> >
> > Did you mean errno != EEXIST?
>
> I blindly copied code from lxc_one_cgroup_create (now
> create_lxcgroups :)
That has:
if (ret == -1 && errno != EEXIST) {
> > > @@ -384,6 +430,10 @@ static int lxc_one_cgroup_create(const c
> > > SYSERROR("Failed creating pathname for cgroup parent (%d)\n", ret);
> > > return -1;
> > > }
> > > +
> > > + if (enable_hierarchy(cgparent))
> > > + return -1;
> >
> > Hm, do we want to fail container start on that, or just log a warning?
>
> Hmm, probably log a warning (but if you can't create a file in the main
> top directory, you are probably very doomed IMHO ;)
You're right - you don't return -1 if the file doesn't exist, so what
you have is fine.
More information about the lxc-users
mailing list