Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lxc
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
lxc
Commits
87f349ac
Commit
87f349ac
authored
Sep 20, 2017
by
Stéphane Graber
Committed by
GitHub
Sep 20, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1821 from…
Merge pull request #1821 from brauner/2017-09-19/fail_on_when_setting_limits_on_unavailable_controllers cgfsng: fail when limits fail to apply
parents
5355740f
b3646d7e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
11 deletions
+18
-11
cgfsng.c
src/lxc/cgroups/cgfsng.c
+18
-11
No files found.
src/lxc/cgroups/cgfsng.c
View file @
87f349ac
...
@@ -2009,15 +2009,16 @@ out:
...
@@ -2009,15 +2009,16 @@ out:
*/
*/
static
int
lxc_cgroup_set_data
(
const
char
*
filename
,
const
char
*
value
,
struct
cgfsng_handler_data
*
d
)
static
int
lxc_cgroup_set_data
(
const
char
*
filename
,
const
char
*
value
,
struct
cgfsng_handler_data
*
d
)
{
{
char
*
subsystem
=
NULL
,
*
p
;
char
*
fullpath
,
*
p
;
int
ret
=
0
;
struct
hierarchy
*
h
;
/* "b|c <2^64-1>:<2^64-1> r|w|m" = 47 chars max */
/* "b|c <2^64-1>:<2^64-1> r|w|m" = 47 chars max */
char
converted_value
[
50
];
char
converted_value
[
50
];
struct
hierarchy
*
h
;
int
ret
=
0
;
char
*
controller
=
NULL
;
subsystem
=
alloca
(
strlen
(
filename
)
+
1
);
controller
=
alloca
(
strlen
(
filename
)
+
1
);
strcpy
(
subsystem
,
filename
);
strcpy
(
controller
,
filename
);
if
((
p
=
strchr
(
subsystem
,
'.'
))
!=
NULL
)
if
((
p
=
strchr
(
controller
,
'.'
))
!=
NULL
)
*
p
=
'\0'
;
*
p
=
'\0'
;
if
(
strcmp
(
"devices.allow"
,
filename
)
==
0
&&
value
[
0
]
==
'/'
)
{
if
(
strcmp
(
"devices.allow"
,
filename
)
==
0
&&
value
[
0
]
==
'/'
)
{
...
@@ -2028,12 +2029,18 @@ static int lxc_cgroup_set_data(const char *filename, const char *value, struct c
...
@@ -2028,12 +2029,18 @@ static int lxc_cgroup_set_data(const char *filename, const char *value, struct c
}
}
h
=
get_hierarchy
(
subsystem
);
h
=
get_hierarchy
(
controller
);
if
(
h
)
{
if
(
!
h
)
{
char
*
fullpath
=
must_make_path
(
h
->
fullcgpath
,
filename
,
NULL
);
ERROR
(
"Failed to setup limits for the
\"
%s
\"
controller. "
ret
=
lxc_write_to_file
(
fullpath
,
value
,
strlen
(
value
),
false
);
"The controller seems to be unused by
\"
cgfsng
\"
cgroup "
free
(
fullpath
);
"driver or not enabled on the cgroup hierarchy"
,
controller
);
return
-
1
;
}
}
fullpath
=
must_make_path
(
h
->
fullcgpath
,
filename
,
NULL
);
ret
=
lxc_write_to_file
(
fullpath
,
value
,
strlen
(
value
),
false
);
free
(
fullpath
);
return
ret
;
return
ret
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment