[CRIU] [PATCH 2/2] cg: Add ability to dump custom cgroup properties

Tycho Andersen tycho.andersen at canonical.com
Thu Apr 14 07:49:09 PDT 2016


On Thu, Apr 14, 2016 at 05:47:34PM +0300, Cyrill Gorcunov wrote:
> On Thu, Apr 14, 2016 at 08:41:10AM -0600, Tycho Andersen wrote:
> > > 
> > > At moment we require Jansson library to be present in the
> > > system to support JSON parsing of --cgroup-props. But if
> > > someone doesn't need custom properties lets don't force
> > > him to setup Jansson library for nothing, simply compile
> > > criu without this feature support.
> > 
> > Not related to this patch, but it seems like I've let the list of
> > predefined properties get fairly out of date (e.g. the entire pids
> > cgroups, and a bunch of others are missing). It seems to me like we
> > should have CRIU have a reasonably comprehensive list of cgroup props,
> > and then leave this for other stuff (like custom cgroups in the vz
> > kernel or whatever). Does that make sense? If so, I can send a patch,
> > but probably not until after ubuntu release :)
> 
> Hi Tycho! Yeah, need to revisit the modern set to figure out what's
> missing/changed. But at moment I wanna simply move existing into new
> file and we can update them anytime we find suitable. So yes, if you
> send the patch, this gonna be awesome! Doesn't matter when ;)
> 
> > 
> > > +	/*
> > > +	 * It's either plain JSON stream, then it must
> > > +	 * start with '{', or it's path to a file to parse.
> > > +	 */
> > > +	if (arg[0] == '{') {
> > 
> > Minor thing, but can we do this check the "other" way, i.e. test for
> > the first char == '/'? It would be legal json to have leading
> > whitespace, so if some unparser somewhere emitted with a leading space
> > or \n or something this might break. The filename has to start with a
> > / though, so it seems slightly safer.
> 
> Pavel already pointed that better provide a separate option for stdin
> stream and read from file. I'll do that (and CC you as well), thanks!

Oh, okay :). Thanks for this!

Tycho


More information about the CRIU mailing list