Blame SOURCES/libcgroup-0.41-extending-cgroup-names-with-default.patch

4b3140
From c3b2fbe31273ea71a02c86e780f0f3c0a0fa845f Mon Sep 17 00:00:00 2001
4b3140
From: Jan Chaloupka <jchaloup@redhat.com>
4b3140
Date: Sat, 20 Sep 2014 23:46:57 +0200
4b3140
Subject: [PATCH] extending cgroup names with default
4b3140
4b3140
---
4b3140
 src/lex.l   |  2 +-
4b3140
 src/parse.y | 14 ++++++++++++--
4b3140
 2 files changed, 13 insertions(+), 3 deletions(-)
4b3140
4b3140
diff --git a/src/lex.l b/src/lex.l
4b3140
index 1b357db..ff2b3e5 100644
4b3140
--- a/src/lex.l
4b3140
+++ b/src/lex.l
4b3140
@@ -42,7 +42,7 @@ jmp_buf parser_error_env;
4b3140
 "group"		{return GROUP;}
4b3140
 "namespace"	{return NAMESPACE;}
4b3140
 "template"	{return TEMPLATE;}
4b3140
-"default"	{return DEFAULT;}
4b3140
+"default"	{yylval.name = strdup(yytext); return DEFAULT;}
4b3140
 [a-zA-Z0-9_\-\/\.\,\%\@]+ {yylval.name = strdup(yytext); return ID;}
4b3140
 \"[^"]*\" {yylval.name = strdup(yytext+1); yylval.name[strlen(yylval.name)-1] = '\0'; return ID; }
4b3140
 .	{return yytext[0];}
4b3140
diff --git a/src/parse.y b/src/parse.y
4b3140
index 9adbc0e..e67ad54 100644
4b3140
--- a/src/parse.y
4b3140
+++ b/src/parse.y
4b3140
@@ -45,7 +45,7 @@ int yywrap(void)
4b3140
 	int val;
4b3140
 	struct cgroup_dictionary *values;
4b3140
 }
4b3140
-%type <name> ID
4b3140
+%type <name> ID DEFAULT group_name
4b3140
 %type <val> mountvalue_conf mount task_namevalue_conf admin_namevalue_conf
4b3140
 %type <val> admin_conf task_conf task_or_admin group_conf group start
4b3140
 %type <val> namespace namespace_conf default default_conf
4b3140
@@ -99,7 +99,7 @@ default_conf
4b3140
 	}
4b3140
 	;
4b3140
 
4b3140
-group   :       GROUP ID '{' group_conf '}'
4b3140
+group   :       GROUP group_name '{' group_conf '}'
4b3140
 	{
4b3140
 		$$ = $4;
4b3140
 		if ($$) {
4b3140
@@ -119,6 +119,16 @@ group   :       GROUP ID '{' group_conf '}'
4b3140
 	}
4b3140
         ;
4b3140
 
4b3140
+group_name
4b3140
+	:	ID
4b3140
+	{
4b3140
+		$$ = $1;
4b3140
+	}
4b3140
+	|	DEFAULT
4b3140
+	{
4b3140
+		$$ = $1;
4b3140
+	}
4b3140
+
4b3140
 group_conf
4b3140
         :       ID '{' namevalue_conf '}'
4b3140
 	{
4b3140
-- 
4b3140
1.9.3
4b3140