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

Pavel Emelyanov xemul at virtuozzo.com
Thu Apr 14 06:17:40 PDT 2016


On 04/14/2016 04:12 PM, Cyrill Gorcunov wrote:
> On Thu, Apr 14, 2016 at 04:07:34PM +0300, Pavel Emelyanov wrote:
>>
>>>>>  const cgp_t *cgp_get_props(const char *name)
>>>>>  {
>>>>> +	cgp_list_t *p;
>>>>>  	size_t i;
>>>>>  
>>>>>  	for (i = 0; i < ARRAY_SIZE(cgp_predefined); i++) {
>>>>> @@ -107,5 +289,19 @@ const cgp_t *cgp_get_props(const char *name)
>>>>>  			return &cgp_predefined[i];
>>>>>  	}
>>>>>  
>>>>> +	list_for_each_entry(p, &cgp_list, list) {
>>>>> +		if (!strcmp(p->cgp.name, name))
>>>>> +			return &p->cgp;
>>>>
>>>> This makes it impossible to override existing built-in prop lists.
>>>
>>> Do we really want to override predefined prop list?
>>
>> Not only override, but also extend I would say ;)
> 
> OK, which strategy the is preferred for you? Should we override
> predefined props or simply extend them?

That's good question. Hopefully just overriding would be enough. At least
for the beginning.

-- Pavel


More information about the CRIU mailing list