Hello,
there is a bug in the cgconfig.conf parser. Let's have following piece
of config:
group_test {
cpuset {
cpuset.cpus = 0;
cpuset.mems = 0;
}
}
Looking at the parser of name/value pairs in parse.y, the beginning
looks OK (standalone 'name=value;'):
namevalue_conf
: ID '=' ID ';'
{
$1 = realloc($1, strlen($1) + strlen($3) + 2);
$1 = strncat($1, " ", strlen(" "));
$$ = strncat($1, $3, strlen($3));
free($3);
}
But when two name/value pairs are specified, only the second one is
used! $1 is not stored anywhere and gets lost:
| namevalue_conf ID '=' ID ';'
{
$2 = realloc($2, strlen($2) + strlen($4) + 2);
$2 = strncat($2, " ", strlen(" "));
$$ = strncat($2, $4, strlen($4));
free($4);
}
The cgconfigparser sets only the second value and it does not display
any warning.
I am afraid I am no yacc/bison guru and can't even say in what structure
the name/value pairs should be stored. A list? Or a string
"name=value;name2=value2"? For the second proposal I can create a patch,
but it looks ugly to me to parse 'name = value;\n\tname2 = value2;\n'
into 'name=value;name2=value2' and parse it again in
cgroup_config_parse_controller_options().
Jan
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Libcg-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libcg-devel