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
c988c8b1
Unverified
Commit
c988c8b1
authored
Feb 15, 2021
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cgroups: move cgns_supported() to cgroup utilities
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
4b946797
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
17 additions
and
8 deletions
+17
-8
attach.c
src/lxc/attach.c
+2
-1
cgroup_utils.h
src/lxc/cgroups/cgroup_utils.h
+11
-0
apparmor.c
src/lxc/lsm/apparmor.c
+1
-0
start.c
src/lxc/start.c
+2
-1
utils.c
src/lxc/utils.c
+0
-5
utils.h
src/lxc/utils.h
+0
-1
lxc_raw_clone.c
src/tests/lxc_raw_clone.c
+1
-0
No files found.
src/lxc/attach.c
View file @
c988c8b1
...
@@ -27,7 +27,8 @@
...
@@ -27,7 +27,8 @@
#include "af_unix.h"
#include "af_unix.h"
#include "attach.h"
#include "attach.h"
#include "caps.h"
#include "caps.h"
#include "cgroup.h"
#include "cgroups/cgroup.h"
#include "cgroups/cgroup_utils.h"
#include "commands.h"
#include "commands.h"
#include "conf.h"
#include "conf.h"
#include "config.h"
#include "config.h"
...
...
src/lxc/cgroups/cgroup_utils.h
View file @
c988c8b1
...
@@ -7,6 +7,7 @@
...
@@ -7,6 +7,7 @@
#include <stdio.h>
#include <stdio.h>
#include "compiler.h"
#include "compiler.h"
#include "file_utils.h"
/* Retrieve the cgroup version of a given entry from /proc/<pid>/mountinfo. */
/* Retrieve the cgroup version of a given entry from /proc/<pid>/mountinfo. */
__hidden
extern
int
get_cgroup_version
(
char
*
line
);
__hidden
extern
int
get_cgroup_version
(
char
*
line
);
...
@@ -32,4 +33,14 @@ __hidden extern int unified_cgroup_hierarchy(void);
...
@@ -32,4 +33,14 @@ __hidden extern int unified_cgroup_hierarchy(void);
__hidden
extern
int
unified_cgroup_fd
(
int
fd
);
__hidden
extern
int
unified_cgroup_fd
(
int
fd
);
static
inline
bool
cgns_supported
(
void
)
{
static
int
supported
=
-
1
;
if
(
supported
==
-
1
)
supported
=
file_exists
(
"/proc/self/ns/cgroup"
);
return
supported
==
1
;
}
#endif
/* __LXC_CGROUP_UTILS_H */
#endif
/* __LXC_CGROUP_UTILS_H */
src/lxc/lsm/apparmor.c
View file @
c988c8b1
...
@@ -13,6 +13,7 @@
...
@@ -13,6 +13,7 @@
#include <unistd.h>
#include <unistd.h>
#include "caps.h"
#include "caps.h"
#include "cgroups/cgroup_utils.h"
#include "conf.h"
#include "conf.h"
#include "config.h"
#include "config.h"
#include "initutils.h"
#include "initutils.h"
...
...
src/lxc/start.c
View file @
c988c8b1
...
@@ -27,7 +27,8 @@
...
@@ -27,7 +27,8 @@
#include "af_unix.h"
#include "af_unix.h"
#include "caps.h"
#include "caps.h"
#include "cgroup.h"
#include "cgroups/cgroup.h"
#include "cgroups/cgroup_utils.h"
#include "commands.h"
#include "commands.h"
#include "commands_utils.h"
#include "commands_utils.h"
#include "compiler.h"
#include "compiler.h"
...
...
src/lxc/utils.c
View file @
c988c8b1
...
@@ -747,11 +747,6 @@ char *on_path(const char *cmd, const char *rootfs)
...
@@ -747,11 +747,6 @@ char *on_path(const char *cmd, const char *rootfs)
return
NULL
;
return
NULL
;
}
}
bool
cgns_supported
(
void
)
{
return
file_exists
(
"/proc/self/ns/cgroup"
);
}
/* historically lxc-init has been under /usr/lib/lxc and under
/* historically lxc-init has been under /usr/lib/lxc and under
* /usr/lib/$ARCH/lxc. It now lives as $prefix/sbin/init.lxc.
* /usr/lib/$ARCH/lxc. It now lives as $prefix/sbin/init.lxc.
*/
*/
...
...
src/lxc/utils.h
View file @
c988c8b1
...
@@ -138,7 +138,6 @@ __hidden extern bool is_shared_mountpoint(const char *path);
...
@@ -138,7 +138,6 @@ __hidden extern bool is_shared_mountpoint(const char *path);
__hidden
extern
int
detect_shared_rootfs
(
void
);
__hidden
extern
int
detect_shared_rootfs
(
void
);
__hidden
extern
bool
detect_ramfs_rootfs
(
void
);
__hidden
extern
bool
detect_ramfs_rootfs
(
void
);
__hidden
extern
char
*
on_path
(
const
char
*
cmd
,
const
char
*
rootfs
);
__hidden
extern
char
*
on_path
(
const
char
*
cmd
,
const
char
*
rootfs
);
__hidden
extern
bool
cgns_supported
(
void
);
__hidden
extern
char
*
choose_init
(
const
char
*
rootfs
);
__hidden
extern
char
*
choose_init
(
const
char
*
rootfs
);
__hidden
extern
bool
switch_to_ns
(
pid_t
pid
,
const
char
*
ns
);
__hidden
extern
bool
switch_to_ns
(
pid_t
pid
,
const
char
*
ns
);
__hidden
extern
char
*
get_template_path
(
const
char
*
t
);
__hidden
extern
char
*
get_template_path
(
const
char
*
t
);
...
...
src/tests/lxc_raw_clone.c
View file @
c988c8b1
...
@@ -37,6 +37,7 @@
...
@@ -37,6 +37,7 @@
#include <sys/stat.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/types.h>
#include "cgroups/cgroup_utils.h"
#include "lxctest.h"
#include "lxctest.h"
#include "namespace.h"
#include "namespace.h"
#include "process_utils.h"
#include "process_utils.h"
...
...
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