On Fri, Jun 29, 2012 at 3:17 PM, Glauber Costa <glom...@parallels.com> wrote:
> On 06/29/2012 01:37 PM, Dhaval Giani wrote:
>> This API does two things,
>> 1. Reads a controller structure to see if a value exists. If it does, then
>> it returns it.
>> 2. If the value does not exist, then it reads the filesystem to get that
>> value, and then return it.
>
> I don't understand why it needs to be a new API. It seems to me this
> should be the default behavior of cgroup_get_value_string().
>

For the purpose of testing, I would keep it as a separate API. I am
still not fully sure that I want to merge it into that API, because of
some thoughts (some may not be valid, but..)

1. Conceptually, those APIs are for in-memory structures, not for
reading from the file system.
2. Now, a bad user might entail doing a cgroup_get_cgroup every time.
However, doing a cgroup_get_cgroup once and then use that cgroup in
the get_value_string API. That would mean this API is not needed in
any case.

I need to think this a bit more though :(.

Dhaval

> It is inefficient to have this extra test, since users of that API
> should call cgroup_get_cgroup() themselves. But reality is
> cgroup_get_cgroup() doesn't work, so I, and possibly others, have code
> working around it.
>
> Therefore, this inefficiency comes only as a penalty for that. Whoever
> has a use case where is possible to call cgroup_get_cgroup() before
> cgroup_get_value_string() won't pay it.
>
>

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Libcg-devel mailing list
Libcg-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libcg-devel

Reply via email to