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
ab8cd5d9
Unverified
Commit
ab8cd5d9
authored
Feb 15, 2021
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cgroups: pass handler to cgroup mount() method
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
6d25a524
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
3 deletions
+4
-3
cgfsng.c
src/lxc/cgroups/cgfsng.c
+2
-1
cgroup.h
src/lxc/cgroups/cgroup.h
+1
-1
conf.c
src/lxc/conf.c
+1
-1
No files found.
src/lxc/cgroups/cgfsng.c
View file @
ab8cd5d9
...
@@ -1867,11 +1867,12 @@ static inline int cg_mount_cgroup_full(int type, struct hierarchy *h,
...
@@ -1867,11 +1867,12 @@ static inline int cg_mount_cgroup_full(int type, struct hierarchy *h,
}
}
__cgfsng_ops
static
bool
cgfsng_mount
(
struct
cgroup_ops
*
ops
,
__cgfsng_ops
static
bool
cgfsng_mount
(
struct
cgroup_ops
*
ops
,
struct
lxc_
conf
*
conf
,
int
type
)
struct
lxc_
handler
*
handler
,
int
type
)
{
{
__do_close
int
dfd_mnt_cgroupfs
=
-
EBADF
,
fd_fs
=
-
EBADF
;
__do_close
int
dfd_mnt_cgroupfs
=
-
EBADF
,
fd_fs
=
-
EBADF
;
__do_free
char
*
cgroup_root
=
NULL
;
__do_free
char
*
cgroup_root
=
NULL
;
bool
has_cgns
=
false
,
wants_force_mount
=
false
;
bool
has_cgns
=
false
,
wants_force_mount
=
false
;
struct
lxc_conf
*
conf
=
handler
->
conf
;
struct
lxc_rootfs
*
rootfs
=
&
conf
->
rootfs
;
struct
lxc_rootfs
*
rootfs
=
&
conf
->
rootfs
;
const
char
*
rootfs_mnt
=
get_rootfs_mnt
(
rootfs
);
const
char
*
rootfs_mnt
=
get_rootfs_mnt
(
rootfs
);
int
ret
;
int
ret
;
...
...
src/lxc/cgroups/cgroup.h
View file @
ab8cd5d9
...
@@ -172,7 +172,7 @@ struct cgroup_ops {
...
@@ -172,7 +172,7 @@ struct cgroup_ops {
bool
(
*
chown
)(
struct
cgroup_ops
*
ops
,
struct
lxc_conf
*
conf
);
bool
(
*
chown
)(
struct
cgroup_ops
*
ops
,
struct
lxc_conf
*
conf
);
bool
(
*
attach
)(
struct
cgroup_ops
*
ops
,
const
struct
lxc_conf
*
conf
,
bool
(
*
attach
)(
struct
cgroup_ops
*
ops
,
const
struct
lxc_conf
*
conf
,
const
char
*
name
,
const
char
*
lxcpath
,
pid_t
pid
);
const
char
*
name
,
const
char
*
lxcpath
,
pid_t
pid
);
bool
(
*
mount
)(
struct
cgroup_ops
*
ops
,
struct
lxc_
conf
*
conf
,
int
type
);
bool
(
*
mount
)(
struct
cgroup_ops
*
ops
,
struct
lxc_
handler
*
handler
,
int
type
);
bool
(
*
devices_activate
)(
struct
cgroup_ops
*
ops
,
bool
(
*
devices_activate
)(
struct
cgroup_ops
*
ops
,
struct
lxc_handler
*
handler
);
struct
lxc_handler
*
handler
);
bool
(
*
monitor_delegate_controllers
)(
struct
cgroup_ops
*
ops
);
bool
(
*
monitor_delegate_controllers
)(
struct
cgroup_ops
*
ops
);
...
...
src/lxc/conf.c
View file @
ab8cd5d9
...
@@ -704,7 +704,7 @@ static int lxc_mount_auto_mounts(struct lxc_handler *handler, int flags)
...
@@ -704,7 +704,7 @@ static int lxc_mount_auto_mounts(struct lxc_handler *handler, int flags)
if
(
flags
&
LXC_AUTO_CGROUP_FORCE
)
if
(
flags
&
LXC_AUTO_CGROUP_FORCE
)
cg_flags
|=
LXC_AUTO_CGROUP_FORCE
;
cg_flags
|=
LXC_AUTO_CGROUP_FORCE
;
if
(
!
handler
->
cgroup_ops
->
mount
(
handler
->
cgroup_ops
,
conf
,
cg_flags
))
if
(
!
handler
->
cgroup_ops
->
mount
(
handler
->
cgroup_ops
,
handler
,
cg_flags
))
return
log_error_errno
(
-
1
,
errno
,
"Failed to mount
\"
/sys/fs/cgroup
\"
"
);
return
log_error_errno
(
-
1
,
errno
,
"Failed to mount
\"
/sys/fs/cgroup
\"
"
);
}
}
...
...
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