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

Pavel Emelyanov xemul at virtuozzo.com
Fri May 13 08:00:55 PDT 2016


On 05/09/2016 09:45 AM, Cyrill Gorcunov wrote:
> On Fri, May 06, 2016 at 10:17:28AM -0500, Tycho Andersen wrote:
>>>
>>> Hm... Actually the plan was to simplify this and let people update cgroups.yaml
>>> by hands if they need it w/o the need to recompile criu binary.
>>
>> Well, with the addition of the --cgroup-props-file and the overriding
>> mode people don't need to edit a global file or the source, they can
>> just pass an additional argument and get the defaults or not as they
>> wish. I definitely see the advantage of being able to add
>> controllers/props without recompiling, but I think this feature
>> already supports that without moving the properties to a file.
> 
> Exactly. I would prefer to live without default cgroups.yaml too,
> but as Pavel requests... So, Pavel, your final word -- should I
> implement it or no?

OK, let's have predefined list of props in code, but:

> 
> +static struct list_head cgp_predefined_list = {
> + .next = &cgp_predefined[0].list,
> + .prev = &cgp_predefined[4].list,
> +};
> +
> ...
> +static LIST_HEAD(cgp_list);
> +
> ...
> +const cgp_t *cgp_get_props(const char *name)
> +{
> + cgp_list_entry_t *p;
> +
> + p = cgp_get_predefined(name);
> + if (p)
> + return &p->cgp;
> +
> + list_for_each_entry(p, &cgp_list, list) {
> + if (!strcmp(p->cgp.name, name))
> + return &p->cgp;
> + }
> +
> + return NULL;
> +}
> +

can we leave only one list of stuff here?

-- Pavel


More information about the CRIU mailing list