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

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