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
d7e0fb80
Commit
d7e0fb80
authored
Sep 14, 2016
by
Tycho Andersen
Committed by
Stéphane Graber
Sep 23, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cgroup: drop cgroup_canonical_path
This is almost never the right thing to use, and we don't use it any more anyway. Signed-off-by:
Tycho Andersen
<
tycho.andersen@canonical.com
>
parent
a6f6d468
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
0 additions
and
60 deletions
+0
-60
cgfs.c
src/lxc/cgroups/cgfs.c
+0
-23
cgfsng.c
src/lxc/cgroups/cgfsng.c
+0
-8
cgmanager.c
src/lxc/cgroups/cgmanager.c
+0
-10
cgroup.c
src/lxc/cgroups/cgroup.c
+0
-13
cgroup.h
src/lxc/cgroups/cgroup.h
+0
-6
No files found.
src/lxc/cgroups/cgfs.c
View file @
d7e0fb80
...
@@ -2363,28 +2363,6 @@ static const char *cgfs_get_cgroup(void *hdata, const char *subsystem)
...
@@ -2363,28 +2363,6 @@ static const char *cgfs_get_cgroup(void *hdata, const char *subsystem)
return
lxc_cgroup_get_hierarchy_path_data
(
subsystem
,
d
);
return
lxc_cgroup_get_hierarchy_path_data
(
subsystem
,
d
);
}
}
static
const
char
*
cgfs_canonical_path
(
void
*
hdata
)
{
struct
cgfs_data
*
d
=
hdata
;
struct
cgroup_process_info
*
info_ptr
;
char
*
path
=
NULL
;
if
(
!
d
)
return
NULL
;
for
(
info_ptr
=
d
->
info
;
info_ptr
;
info_ptr
=
info_ptr
->
next
)
{
if
(
!
path
)
path
=
info_ptr
->
cgroup_path
;
else
if
(
strcmp
(
path
,
info_ptr
->
cgroup_path
)
!=
0
)
{
ERROR
(
"not all paths match %s, %s has path %s"
,
path
,
info_ptr
->
hierarchy
->
subsystems
[
0
],
info_ptr
->
cgroup_path
);
return
NULL
;
}
}
return
path
;
}
static
bool
cgfs_escape
(
void
*
hdata
)
static
bool
cgfs_escape
(
void
*
hdata
)
{
{
struct
cgroup_meta_data
*
md
;
struct
cgroup_meta_data
*
md
;
...
@@ -2637,7 +2615,6 @@ static struct cgroup_ops cgfs_ops = {
...
@@ -2637,7 +2615,6 @@ static struct cgroup_ops cgfs_ops = {
.
enter
=
cgfs_enter
,
.
enter
=
cgfs_enter
,
.
create_legacy
=
cgfs_create_legacy
,
.
create_legacy
=
cgfs_create_legacy
,
.
get_cgroup
=
cgfs_get_cgroup
,
.
get_cgroup
=
cgfs_get_cgroup
,
.
canonical_path
=
cgfs_canonical_path
,
.
escape
=
cgfs_escape
,
.
escape
=
cgfs_escape
,
.
num_hierarchies
=
cgfs_num_hierarchies
,
.
num_hierarchies
=
cgfs_num_hierarchies
,
.
get_hierarchies
=
cgfs_get_hierarchies
,
.
get_hierarchies
=
cgfs_get_hierarchies
,
...
...
src/lxc/cgroups/cgfsng.c
View file @
d7e0fb80
...
@@ -1087,13 +1087,6 @@ out_free:
...
@@ -1087,13 +1087,6 @@ out_free:
return
false
;
return
false
;
}
}
static
const
char
*
cgfsng_canonical_path
(
void
*
hdata
)
{
struct
cgfsng_handler_data
*
d
=
hdata
;
return
d
->
container_cgroup
;
}
static
bool
cgfsng_enter
(
void
*
hdata
,
pid_t
pid
)
static
bool
cgfsng_enter
(
void
*
hdata
,
pid_t
pid
)
{
{
char
pidstr
[
25
];
char
pidstr
[
25
];
...
@@ -1686,7 +1679,6 @@ static struct cgroup_ops cgfsng_ops = {
...
@@ -1686,7 +1679,6 @@ static struct cgroup_ops cgfsng_ops = {
.
destroy
=
cgfsng_destroy
,
.
destroy
=
cgfsng_destroy
,
.
create
=
cgfsng_create
,
.
create
=
cgfsng_create
,
.
enter
=
cgfsng_enter
,
.
enter
=
cgfsng_enter
,
.
canonical_path
=
cgfsng_canonical_path
,
.
escape
=
cgfsng_escape
,
.
escape
=
cgfsng_escape
,
.
num_hierarchies
=
cgfsng_num_hierarchies
,
.
num_hierarchies
=
cgfsng_num_hierarchies
,
.
get_hierarchies
=
cgfsng_get_hierarchies
,
.
get_hierarchies
=
cgfsng_get_hierarchies
,
...
...
src/lxc/cgroups/cgmanager.c
View file @
d7e0fb80
...
@@ -746,15 +746,6 @@ static const char *cgm_get_cgroup(void *hdata, const char *subsystem)
...
@@ -746,15 +746,6 @@ static const char *cgm_get_cgroup(void *hdata, const char *subsystem)
return
d
->
cgroup_path
;
return
d
->
cgroup_path
;
}
}
static
const
char
*
cgm_canonical_path
(
void
*
hdata
)
{
struct
cgm_data
*
d
=
hdata
;
if
(
!
d
||
!
d
->
cgroup_path
)
return
NULL
;
return
d
->
cgroup_path
;
}
#if HAVE_CGMANAGER_GET_PID_CGROUP_ABS_SYNC
#if HAVE_CGMANAGER_GET_PID_CGROUP_ABS_SYNC
static
inline
bool
abs_cgroup_supported
(
void
)
{
static
inline
bool
abs_cgroup_supported
(
void
)
{
return
api_version
>=
CGM_SUPPORTS_GET_ABS
;
return
api_version
>=
CGM_SUPPORTS_GET_ABS
;
...
@@ -1667,7 +1658,6 @@ static struct cgroup_ops cgmanager_ops = {
...
@@ -1667,7 +1658,6 @@ static struct cgroup_ops cgmanager_ops = {
.
enter
=
cgm_enter
,
.
enter
=
cgm_enter
,
.
create_legacy
=
NULL
,
.
create_legacy
=
NULL
,
.
get_cgroup
=
cgm_get_cgroup
,
.
get_cgroup
=
cgm_get_cgroup
,
.
canonical_path
=
cgm_canonical_path
,
.
escape
=
cgm_escape
,
.
escape
=
cgm_escape
,
.
num_hierarchies
=
cgm_num_hierarchies
,
.
num_hierarchies
=
cgm_num_hierarchies
,
.
get_hierarchies
=
cgm_get_hierarchies
,
.
get_hierarchies
=
cgm_get_hierarchies
,
...
...
src/lxc/cgroups/cgroup.c
View file @
d7e0fb80
...
@@ -119,19 +119,6 @@ bool cgroup_escape(struct lxc_handler *handler)
...
@@ -119,19 +119,6 @@ bool cgroup_escape(struct lxc_handler *handler)
return
false
;
return
false
;
}
}
const
char
*
cgroup_canonical_path
(
struct
lxc_handler
*
handler
)
{
if
(
geteuid
())
{
WARN
(
"cgroup_canonical_path only makes sense for privileged containers.
\n
"
);
return
NULL
;
}
if
(
ops
)
return
ops
->
canonical_path
(
handler
->
cgroup_data
);
return
NULL
;
}
int
cgroup_num_hierarchies
(
void
)
int
cgroup_num_hierarchies
(
void
)
{
{
if
(
!
ops
)
if
(
!
ops
)
...
...
src/lxc/cgroups/cgroup.h
View file @
d7e0fb80
...
@@ -47,7 +47,6 @@ struct cgroup_ops {
...
@@ -47,7 +47,6 @@ struct cgroup_ops {
bool
(
*
enter
)(
void
*
hdata
,
pid_t
pid
);
bool
(
*
enter
)(
void
*
hdata
,
pid_t
pid
);
bool
(
*
create_legacy
)(
void
*
hdata
,
pid_t
pid
);
bool
(
*
create_legacy
)(
void
*
hdata
,
pid_t
pid
);
const
char
*
(
*
get_cgroup
)(
void
*
hdata
,
const
char
*
subsystem
);
const
char
*
(
*
get_cgroup
)(
void
*
hdata
,
const
char
*
subsystem
);
const
char
*
(
*
canonical_path
)(
void
*
hdata
);
bool
(
*
escape
)();
bool
(
*
escape
)();
int
(
*
num_hierarchies
)();
int
(
*
num_hierarchies
)();
bool
(
*
get_hierarchies
)(
int
n
,
char
***
out
);
bool
(
*
get_hierarchies
)(
int
n
,
char
***
out
);
...
@@ -78,11 +77,6 @@ extern const char *cgroup_get_cgroup(struct lxc_handler *handler, const char *su
...
@@ -78,11 +77,6 @@ extern const char *cgroup_get_cgroup(struct lxc_handler *handler, const char *su
extern
bool
cgroup_escape
();
extern
bool
cgroup_escape
();
extern
int
cgroup_num_hierarchies
();
extern
int
cgroup_num_hierarchies
();
extern
bool
cgroup_get_hierarchies
(
int
i
,
char
***
out
);
extern
bool
cgroup_get_hierarchies
(
int
i
,
char
***
out
);
/*
* Currently, this call only makes sense for privileged containers.
*/
extern
const
char
*
cgroup_canonical_path
(
struct
lxc_handler
*
handler
);
extern
bool
cgroup_unfreeze
(
struct
lxc_handler
*
handler
);
extern
bool
cgroup_unfreeze
(
struct
lxc_handler
*
handler
);
extern
void
cgroup_disconnect
(
void
);
extern
void
cgroup_disconnect
(
void
);
extern
cgroup_driver_t
cgroup_driver
(
void
);
extern
cgroup_driver_t
cgroup_driver
(
void
);
...
...
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