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
cfd0e3b5
Unverified
Commit
cfd0e3b5
authored
Feb 24, 2021
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
commands: s/_LIMITING_/_LIMIT_/g and s/_limiting_/_limit_/g
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
dd65d42a
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
46 additions
and
45 deletions
+46
-45
cgfsng.c
src/lxc/cgroups/cgfsng.c
+9
-9
cgroup.h
src/lxc/cgroups/cgroup.h
+1
-1
commands.c
src/lxc/commands.c
+21
-22
commands.h
src/lxc/commands.h
+7
-5
criu.c
src/lxc/criu.c
+8
-8
No files found.
src/lxc/cgroups/cgfsng.c
View file @
cfd0e3b5
...
@@ -2056,8 +2056,8 @@ __cgfsng_ops static const char *cgfsng_get_cgroup(struct cgroup_ops *ops,
...
@@ -2056,8 +2056,8 @@ __cgfsng_ops static const char *cgfsng_get_cgroup(struct cgroup_ops *ops,
return
cgfsng_get_cgroup_do
(
ops
,
controller
,
false
);
return
cgfsng_get_cgroup_do
(
ops
,
controller
,
false
);
}
}
__cgfsng_ops
static
const
char
*
cgfsng_get_limit
ing
_cgroup
(
struct
cgroup_ops
*
ops
,
__cgfsng_ops
static
const
char
*
cgfsng_get_limit_cgroup
(
struct
cgroup_ops
*
ops
,
const
char
*
controller
)
const
char
*
controller
)
{
{
return
cgfsng_get_cgroup_do
(
ops
,
controller
,
true
);
return
cgfsng_get_cgroup_do
(
ops
,
controller
,
true
);
}
}
...
@@ -2368,7 +2368,7 @@ __cgfsng_ops static int cgfsng_get(struct cgroup_ops *ops, const char *filename,
...
@@ -2368,7 +2368,7 @@ __cgfsng_ops static int cgfsng_get(struct cgroup_ops *ops, const char *filename,
if
(
p
)
if
(
p
)
*
p
=
'\0'
;
*
p
=
'\0'
;
path
=
lxc_cmd_get_limit
ing
_cgroup_path
(
name
,
lxcpath
,
controller
);
path
=
lxc_cmd_get_limit_cgroup_path
(
name
,
lxcpath
,
controller
);
/* not running */
/* not running */
if
(
!
path
)
if
(
!
path
)
return
-
1
;
return
-
1
;
...
@@ -2530,7 +2530,7 @@ __cgfsng_ops static int cgfsng_set(struct cgroup_ops *ops,
...
@@ -2530,7 +2530,7 @@ __cgfsng_ops static int cgfsng_set(struct cgroup_ops *ops,
return
0
;
return
0
;
}
}
path
=
lxc_cmd_get_limit
ing
_cgroup_path
(
name
,
lxcpath
,
controller
);
path
=
lxc_cmd_get_limit_cgroup_path
(
name
,
lxcpath
,
controller
);
/* not running */
/* not running */
if
(
!
path
)
if
(
!
path
)
return
-
1
;
return
-
1
;
...
@@ -3335,7 +3335,7 @@ struct cgroup_ops *cgroup_ops_init(struct lxc_conf *conf)
...
@@ -3335,7 +3335,7 @@ struct cgroup_ops *cgroup_ops_init(struct lxc_conf *conf)
cgfsng_ops
->
chown
=
cgfsng_chown
;
cgfsng_ops
->
chown
=
cgfsng_chown
;
cgfsng_ops
->
mount
=
cgfsng_mount
;
cgfsng_ops
->
mount
=
cgfsng_mount
;
cgfsng_ops
->
devices_activate
=
cgfsng_devices_activate
;
cgfsng_ops
->
devices_activate
=
cgfsng_devices_activate
;
cgfsng_ops
->
get_limit
ing_cgroup
=
cgfsng_get_limiting
_cgroup
;
cgfsng_ops
->
get_limit
_cgroup
=
cgfsng_get_limit
_cgroup
;
cgfsng_ops
->
criu_escape
=
cgfsng_criu_escape
;
cgfsng_ops
->
criu_escape
=
cgfsng_criu_escape
;
cgfsng_ops
->
criu_num_hierarchies
=
cgfsng_criu_num_hierarchies
;
cgfsng_ops
->
criu_num_hierarchies
=
cgfsng_criu_num_hierarchies
;
...
@@ -3455,7 +3455,7 @@ int cgroup_get(const char *name, const char *lxcpath,
...
@@ -3455,7 +3455,7 @@ int cgroup_get(const char *name, const char *lxcpath,
if
((
buf
&&
!
len
)
||
(
len
&&
!
buf
))
if
((
buf
&&
!
len
)
||
(
len
&&
!
buf
))
return
ret_errno
(
EINVAL
);
return
ret_errno
(
EINVAL
);
unified_fd
=
lxc_cmd_get_limit
ing
_cgroup2_fd
(
name
,
lxcpath
);
unified_fd
=
lxc_cmd_get_limit_cgroup2_fd
(
name
,
lxcpath
);
if
(
unified_fd
<
0
)
if
(
unified_fd
<
0
)
return
ret_errno
(
ENOSYS
);
return
ret_errno
(
ENOSYS
);
...
@@ -3477,7 +3477,7 @@ int cgroup_set(const char *name, const char *lxcpath,
...
@@ -3477,7 +3477,7 @@ int cgroup_set(const char *name, const char *lxcpath,
is_empty_string
(
name
)
||
is_empty_string
(
lxcpath
))
is_empty_string
(
name
)
||
is_empty_string
(
lxcpath
))
return
ret_errno
(
EINVAL
);
return
ret_errno
(
EINVAL
);
unified_fd
=
lxc_cmd_get_limit
ing
_cgroup2_fd
(
name
,
lxcpath
);
unified_fd
=
lxc_cmd_get_limit_cgroup2_fd
(
name
,
lxcpath
);
if
(
unified_fd
<
0
)
if
(
unified_fd
<
0
)
return
ret_errno
(
ENOSYS
);
return
ret_errno
(
ENOSYS
);
...
@@ -3553,7 +3553,7 @@ int cgroup_freeze(const char *name, const char *lxcpath, int timeout)
...
@@ -3553,7 +3553,7 @@ int cgroup_freeze(const char *name, const char *lxcpath, int timeout)
if
(
is_empty_string
(
name
)
||
is_empty_string
(
lxcpath
))
if
(
is_empty_string
(
name
)
||
is_empty_string
(
lxcpath
))
return
ret_errno
(
EINVAL
);
return
ret_errno
(
EINVAL
);
unified_fd
=
lxc_cmd_get_limit
ing
_cgroup2_fd
(
name
,
lxcpath
);
unified_fd
=
lxc_cmd_get_limit_cgroup2_fd
(
name
,
lxcpath
);
if
(
unified_fd
<
0
)
if
(
unified_fd
<
0
)
return
ret_errno
(
ENOCGROUP2
);
return
ret_errno
(
ENOCGROUP2
);
...
@@ -3578,7 +3578,7 @@ int cgroup_unfreeze(const char *name, const char *lxcpath, int timeout)
...
@@ -3578,7 +3578,7 @@ int cgroup_unfreeze(const char *name, const char *lxcpath, int timeout)
if
(
is_empty_string
(
name
)
||
is_empty_string
(
lxcpath
))
if
(
is_empty_string
(
name
)
||
is_empty_string
(
lxcpath
))
return
ret_errno
(
EINVAL
);
return
ret_errno
(
EINVAL
);
unified_fd
=
lxc_cmd_get_limit
ing
_cgroup2_fd
(
name
,
lxcpath
);
unified_fd
=
lxc_cmd_get_limit_cgroup2_fd
(
name
,
lxcpath
);
if
(
unified_fd
<
0
)
if
(
unified_fd
<
0
)
return
ret_errno
(
ENOCGROUP2
);
return
ret_errno
(
ENOCGROUP2
);
...
...
src/lxc/cgroups/cgroup.h
View file @
cfd0e3b5
...
@@ -248,7 +248,7 @@ struct cgroup_ops {
...
@@ -248,7 +248,7 @@ struct cgroup_ops {
bool
(
*
monitor_delegate_controllers
)(
struct
cgroup_ops
*
ops
);
bool
(
*
monitor_delegate_controllers
)(
struct
cgroup_ops
*
ops
);
bool
(
*
payload_delegate_controllers
)(
struct
cgroup_ops
*
ops
);
bool
(
*
payload_delegate_controllers
)(
struct
cgroup_ops
*
ops
);
void
(
*
finalize
)(
struct
cgroup_ops
*
ops
);
void
(
*
finalize
)(
struct
cgroup_ops
*
ops
);
const
char
*
(
*
get_limit
ing
_cgroup
)(
struct
cgroup_ops
*
ops
,
const
char
*
controller
);
const
char
*
(
*
get_limit_cgroup
)(
struct
cgroup_ops
*
ops
,
const
char
*
controller
);
};
};
__hidden
extern
struct
cgroup_ops
*
cgroup_init
(
struct
lxc_conf
*
conf
);
__hidden
extern
struct
cgroup_ops
*
cgroup_init
(
struct
lxc_conf
*
conf
);
...
...
src/lxc/commands.c
View file @
cfd0e3b5
...
@@ -84,8 +84,8 @@ static const char *lxc_cmd_str(lxc_cmd_t cmd)
...
@@ -84,8 +84,8 @@ static const char *lxc_cmd_str(lxc_cmd_t cmd)
[
LXC_CMD_UNFREEZE
]
=
"unfreeze"
,
[
LXC_CMD_UNFREEZE
]
=
"unfreeze"
,
[
LXC_CMD_GET_CGROUP2_FD
]
=
"get_cgroup2_fd"
,
[
LXC_CMD_GET_CGROUP2_FD
]
=
"get_cgroup2_fd"
,
[
LXC_CMD_GET_INIT_PIDFD
]
=
"get_init_pidfd"
,
[
LXC_CMD_GET_INIT_PIDFD
]
=
"get_init_pidfd"
,
[
LXC_CMD_GET_LIMIT
ING_CGROUP
]
=
"get_limiting
_cgroup"
,
[
LXC_CMD_GET_LIMIT
_CGROUP
]
=
"get_limit
_cgroup"
,
[
LXC_CMD_GET_LIMIT
ING_CGROUP2_FD
]
=
"get_limiting
_cgroup2_fd"
,
[
LXC_CMD_GET_LIMIT
_CGROUP2_FD
]
=
"get_limit
_cgroup2_fd"
,
[
LXC_CMD_GET_DEVPTS_FD
]
=
"get_devpts_fd"
,
[
LXC_CMD_GET_DEVPTS_FD
]
=
"get_devpts_fd"
,
[
LXC_CMD_GET_SECCOMP_NOTIFY_FD
]
=
"get_seccomp_notify_fd"
,
[
LXC_CMD_GET_SECCOMP_NOTIFY_FD
]
=
"get_seccomp_notify_fd"
,
[
LXC_CMD_GET_CGROUP_CTX
]
=
"get_cgroup_ctx"
,
[
LXC_CMD_GET_CGROUP_CTX
]
=
"get_cgroup_ctx"
,
...
@@ -140,7 +140,7 @@ static int lxc_cmd_rsp_recv(int sock, struct lxc_cmd_rr *cmd)
...
@@ -140,7 +140,7 @@ static int lxc_cmd_rsp_recv(int sock, struct lxc_cmd_rr *cmd)
switch
(
cur_cmd
)
{
switch
(
cur_cmd
)
{
case
LXC_CMD_GET_CGROUP2_FD
:
case
LXC_CMD_GET_CGROUP2_FD
:
__fallthrough
;
__fallthrough
;
case
LXC_CMD_GET_LIMIT
ING
_CGROUP2_FD
:
case
LXC_CMD_GET_LIMIT_CGROUP2_FD
:
__fallthrough
;
__fallthrough
;
case
LXC_CMD_GET_INIT_PIDFD
:
case
LXC_CMD_GET_INIT_PIDFD
:
__fallthrough
;
__fallthrough
;
...
@@ -190,7 +190,7 @@ static int lxc_cmd_rsp_recv(int sock, struct lxc_cmd_rr *cmd)
...
@@ -190,7 +190,7 @@ static int lxc_cmd_rsp_recv(int sock, struct lxc_cmd_rr *cmd)
switch
(
cur_cmd
)
{
switch
(
cur_cmd
)
{
case
LXC_CMD_GET_CGROUP2_FD
:
case
LXC_CMD_GET_CGROUP2_FD
:
__fallthrough
;
__fallthrough
;
case
LXC_CMD_GET_LIMIT
ING
_CGROUP2_FD
:
case
LXC_CMD_GET_LIMIT_CGROUP2_FD
:
__fallthrough
;
__fallthrough
;
case
LXC_CMD_GET_INIT_PIDFD
:
case
LXC_CMD_GET_INIT_PIDFD
:
__fallthrough
;
__fallthrough
;
...
@@ -738,7 +738,7 @@ static char *lxc_cmd_get_cgroup_path_do(const char *name, const char *lxcpath,
...
@@ -738,7 +738,7 @@ static char *lxc_cmd_get_cgroup_path_do(const char *name, const char *lxcpath,
return
NULL
;
return
NULL
;
if
(
ret
==
0
)
{
if
(
ret
==
0
)
{
if
(
command
==
LXC_CMD_GET_LIMIT
ING
_CGROUP
)
{
if
(
command
==
LXC_CMD_GET_LIMIT_CGROUP
)
{
/*
/*
* This may indicate that the container was started
* This may indicate that the container was started
* under an ealier version before
* under an ealier version before
...
@@ -779,10 +779,10 @@ char *lxc_cmd_get_cgroup_path(const char *name, const char *lxcpath,
...
@@ -779,10 +779,10 @@ char *lxc_cmd_get_cgroup_path(const char *name, const char *lxcpath,
}
}
/*
/*
* lxc_cmd_get_limit
ing_cgroup_path: Calculate a container's limiting
cgroup
* lxc_cmd_get_limit
_cgroup_path: Calculate a container's limit
cgroup
* path for a particular subsystem. This is the cgroup path relative to the
* path for a particular subsystem. This is the cgroup path relative to the
* root of the cgroup filesystem. This may be the same as the path returned by
* root of the cgroup filesystem. This may be the same as the path returned by
* lxc_cmd_get_cgroup_path if the container doesn't have a limit
ing
path prefix
* lxc_cmd_get_cgroup_path if the container doesn't have a limit path prefix
* set.
* set.
*
*
* @name : name of container to connect to
* @name : name of container to connect to
...
@@ -792,11 +792,11 @@ char *lxc_cmd_get_cgroup_path(const char *name, const char *lxcpath,
...
@@ -792,11 +792,11 @@ char *lxc_cmd_get_cgroup_path(const char *name, const char *lxcpath,
* Returns the path on success, NULL on failure. The caller must free() the
* Returns the path on success, NULL on failure. The caller must free() the
* returned path.
* returned path.
*/
*/
char
*
lxc_cmd_get_limit
ing
_cgroup_path
(
const
char
*
name
,
const
char
*
lxcpath
,
char
*
lxc_cmd_get_limit_cgroup_path
(
const
char
*
name
,
const
char
*
lxcpath
,
const
char
*
subsystem
)
const
char
*
subsystem
)
{
{
return
lxc_cmd_get_cgroup_path_do
(
name
,
lxcpath
,
subsystem
,
return
lxc_cmd_get_cgroup_path_do
(
name
,
lxcpath
,
subsystem
,
LXC_CMD_GET_LIMIT
ING
_CGROUP
);
LXC_CMD_GET_LIMIT_CGROUP
);
}
}
static
int
lxc_cmd_get_cgroup_callback_do
(
int
fd
,
struct
lxc_cmd_req
*
req
,
static
int
lxc_cmd_get_cgroup_callback_do
(
int
fd
,
struct
lxc_cmd_req
*
req
,
...
@@ -820,7 +820,7 @@ static int lxc_cmd_get_cgroup_callback_do(int fd, struct lxc_cmd_req *req,
...
@@ -820,7 +820,7 @@ static int lxc_cmd_get_cgroup_callback_do(int fd, struct lxc_cmd_req *req,
reqdata
=
NULL
;
reqdata
=
NULL
;
}
}
get_fn
=
(
limiting_cgroup
?
cgroup_ops
->
get_limit
ing
_cgroup
get_fn
=
(
limiting_cgroup
?
cgroup_ops
->
get_limit_cgroup
:
cgroup_ops
->
get_cgroup
);
:
cgroup_ops
->
get_cgroup
);
path
=
get_fn
(
cgroup_ops
,
reqdata
);
path
=
get_fn
(
cgroup_ops
,
reqdata
);
...
@@ -842,9 +842,9 @@ static int lxc_cmd_get_cgroup_callback(int fd, struct lxc_cmd_req *req,
...
@@ -842,9 +842,9 @@ static int lxc_cmd_get_cgroup_callback(int fd, struct lxc_cmd_req *req,
return
lxc_cmd_get_cgroup_callback_do
(
fd
,
req
,
handler
,
descr
,
false
);
return
lxc_cmd_get_cgroup_callback_do
(
fd
,
req
,
handler
,
descr
,
false
);
}
}
static
int
lxc_cmd_get_limit
ing
_cgroup_callback
(
int
fd
,
struct
lxc_cmd_req
*
req
,
static
int
lxc_cmd_get_limit_cgroup_callback
(
int
fd
,
struct
lxc_cmd_req
*
req
,
struct
lxc_handler
*
handler
,
struct
lxc_handler
*
handler
,
struct
lxc_epoll_descr
*
descr
)
struct
lxc_epoll_descr
*
descr
)
{
{
return
ret_errno
(
ENOSYS
);
return
ret_errno
(
ENOSYS
);
}
}
...
@@ -1587,12 +1587,12 @@ int lxc_cmd_get_cgroup2_fd(const char *name, const char *lxcpath)
...
@@ -1587,12 +1587,12 @@ int lxc_cmd_get_cgroup2_fd(const char *name, const char *lxcpath)
return
PTR_TO_INT
(
cmd
.
rsp
.
data
);
return
PTR_TO_INT
(
cmd
.
rsp
.
data
);
}
}
int
lxc_cmd_get_limit
ing
_cgroup2_fd
(
const
char
*
name
,
const
char
*
lxcpath
)
int
lxc_cmd_get_limit_cgroup2_fd
(
const
char
*
name
,
const
char
*
lxcpath
)
{
{
int
ret
,
stopped
;
int
ret
,
stopped
;
struct
lxc_cmd_rr
cmd
=
{
struct
lxc_cmd_rr
cmd
=
{
.
req
=
{
.
req
=
{
.
cmd
=
LXC_CMD_GET_LIMIT
ING
_CGROUP2_FD
,
.
cmd
=
LXC_CMD_GET_LIMIT_CGROUP2_FD
,
},
},
.
rsp
=
{
.
rsp
=
{
.
ret
=
-
ENOSYS
,
.
ret
=
-
ENOSYS
,
...
@@ -1643,10 +1643,9 @@ static int lxc_cmd_get_cgroup2_fd_callback(int fd, struct lxc_cmd_req *req,
...
@@ -1643,10 +1643,9 @@ static int lxc_cmd_get_cgroup2_fd_callback(int fd, struct lxc_cmd_req *req,
false
);
false
);
}
}
static
int
lxc_cmd_get_limiting_cgroup2_fd_callback
(
int
fd
,
static
int
lxc_cmd_get_limit_cgroup2_fd_callback
(
int
fd
,
struct
lxc_cmd_req
*
req
,
struct
lxc_cmd_req
*
req
,
struct
lxc_handler
*
handler
,
struct
lxc_handler
*
handler
,
struct
lxc_epoll_descr
*
descr
)
struct
lxc_epoll_descr
*
descr
)
{
{
return
ret_errno
(
ENOSYS
);
return
ret_errno
(
ENOSYS
);
}
}
...
@@ -1688,8 +1687,8 @@ static int lxc_cmd_process(int fd, struct lxc_cmd_req *req,
...
@@ -1688,8 +1687,8 @@ static int lxc_cmd_process(int fd, struct lxc_cmd_req *req,
[
LXC_CMD_UNFREEZE
]
=
lxc_cmd_unfreeze_callback
,
[
LXC_CMD_UNFREEZE
]
=
lxc_cmd_unfreeze_callback
,
[
LXC_CMD_GET_CGROUP2_FD
]
=
lxc_cmd_get_cgroup2_fd_callback
,
[
LXC_CMD_GET_CGROUP2_FD
]
=
lxc_cmd_get_cgroup2_fd_callback
,
[
LXC_CMD_GET_INIT_PIDFD
]
=
lxc_cmd_get_init_pidfd_callback
,
[
LXC_CMD_GET_INIT_PIDFD
]
=
lxc_cmd_get_init_pidfd_callback
,
[
LXC_CMD_GET_LIMIT
ING_CGROUP
]
=
lxc_cmd_get_limiting
_cgroup_callback
,
[
LXC_CMD_GET_LIMIT
_CGROUP
]
=
lxc_cmd_get_limit
_cgroup_callback
,
[
LXC_CMD_GET_LIMIT
ING_CGROUP2_FD
]
=
lxc_cmd_get_limiting
_cgroup2_fd_callback
,
[
LXC_CMD_GET_LIMIT
_CGROUP2_FD
]
=
lxc_cmd_get_limit
_cgroup2_fd_callback
,
[
LXC_CMD_GET_DEVPTS_FD
]
=
lxc_cmd_get_devpts_fd_callback
,
[
LXC_CMD_GET_DEVPTS_FD
]
=
lxc_cmd_get_devpts_fd_callback
,
[
LXC_CMD_GET_SECCOMP_NOTIFY_FD
]
=
lxc_cmd_get_seccomp_notify_fd_callback
,
[
LXC_CMD_GET_SECCOMP_NOTIFY_FD
]
=
lxc_cmd_get_seccomp_notify_fd_callback
,
[
LXC_CMD_GET_CGROUP_CTX
]
=
lxc_cmd_get_cgroup_ctx_callback
,
[
LXC_CMD_GET_CGROUP_CTX
]
=
lxc_cmd_get_cgroup_ctx_callback
,
...
...
src/lxc/commands.h
View file @
cfd0e3b5
...
@@ -40,8 +40,8 @@ typedef enum {
...
@@ -40,8 +40,8 @@ typedef enum {
LXC_CMD_UNFREEZE
=
16
,
LXC_CMD_UNFREEZE
=
16
,
LXC_CMD_GET_CGROUP2_FD
=
17
,
LXC_CMD_GET_CGROUP2_FD
=
17
,
LXC_CMD_GET_INIT_PIDFD
=
18
,
LXC_CMD_GET_INIT_PIDFD
=
18
,
LXC_CMD_GET_LIMIT
ING
_CGROUP
=
19
,
LXC_CMD_GET_LIMIT_CGROUP
=
19
,
LXC_CMD_GET_LIMIT
ING
_CGROUP2_FD
=
20
,
LXC_CMD_GET_LIMIT_CGROUP2_FD
=
20
,
LXC_CMD_GET_DEVPTS_FD
=
21
,
LXC_CMD_GET_DEVPTS_FD
=
21
,
LXC_CMD_GET_SECCOMP_NOTIFY_FD
=
22
,
LXC_CMD_GET_SECCOMP_NOTIFY_FD
=
22
,
LXC_CMD_GET_CGROUP_CTX
=
23
,
LXC_CMD_GET_CGROUP_CTX
=
23
,
...
@@ -137,9 +137,11 @@ __hidden extern int lxc_cmd_add_bpf_device_cgroup(const char *name, const char *
...
@@ -137,9 +137,11 @@ __hidden extern int lxc_cmd_add_bpf_device_cgroup(const char *name, const char *
__hidden
extern
int
lxc_cmd_freeze
(
const
char
*
name
,
const
char
*
lxcpath
,
int
timeout
);
__hidden
extern
int
lxc_cmd_freeze
(
const
char
*
name
,
const
char
*
lxcpath
,
int
timeout
);
__hidden
extern
int
lxc_cmd_unfreeze
(
const
char
*
name
,
const
char
*
lxcpath
,
int
timeout
);
__hidden
extern
int
lxc_cmd_unfreeze
(
const
char
*
name
,
const
char
*
lxcpath
,
int
timeout
);
__hidden
extern
int
lxc_cmd_get_cgroup2_fd
(
const
char
*
name
,
const
char
*
lxcpath
);
__hidden
extern
int
lxc_cmd_get_cgroup2_fd
(
const
char
*
name
,
const
char
*
lxcpath
);
__hidden
extern
char
*
lxc_cmd_get_limiting_cgroup_path
(
const
char
*
name
,
const
char
*
lxcpath
,
__hidden
extern
char
*
lxc_cmd_get_limit_cgroup_path
(
const
char
*
name
,
const
char
*
subsystem
);
const
char
*
lxcpath
,
__hidden
extern
int
lxc_cmd_get_limiting_cgroup2_fd
(
const
char
*
name
,
const
char
*
lxcpath
);
const
char
*
subsystem
);
__hidden
extern
int
lxc_cmd_get_limit_cgroup2_fd
(
const
char
*
name
,
const
char
*
lxcpath
);
__hidden
extern
int
lxc_cmd_get_devpts_fd
(
const
char
*
name
,
const
char
*
lxcpath
);
__hidden
extern
int
lxc_cmd_get_devpts_fd
(
const
char
*
name
,
const
char
*
lxcpath
);
#endif
/* __commands_h */
#endif
/* __commands_h */
src/lxc/criu.c
View file @
cfd0e3b5
...
@@ -304,19 +304,19 @@ static int exec_criu(struct cgroup_ops *cgroup_ops, struct lxc_conf *conf,
...
@@ -304,19 +304,19 @@ static int exec_criu(struct cgroup_ops *cgroup_ops, struct lxc_conf *conf,
* the handler the restore task created.
* the handler the restore task created.
*/
*/
if
(
strequal
(
opts
->
action
,
"dump"
)
||
strequal
(
opts
->
action
,
"pre-dump"
))
{
if
(
strequal
(
opts
->
action
,
"dump"
)
||
strequal
(
opts
->
action
,
"pre-dump"
))
{
cgroup_base_path
=
lxc_cmd_get_limit
ing
_cgroup_path
(
opts
->
c
->
name
,
opts
->
c
->
config_path
,
controllers_list
[
0
]);
cgroup_base_path
=
lxc_cmd_get_limit_cgroup_path
(
opts
->
c
->
name
,
opts
->
c
->
config_path
,
controllers_list
[
0
]);
if
(
!
cgroup_base_path
)
if
(
!
cgroup_base_path
)
return
log_error_errno
(
-
ENOENT
,
ENOENT
,
"Failed to retrieve limit
ing
cgroup path for %s"
,
controllers_list
[
0
]
?:
"(null)"
);
return
log_error_errno
(
-
ENOENT
,
ENOENT
,
"Failed to retrieve limit cgroup path for %s"
,
controllers_list
[
0
]
?:
"(null)"
);
}
else
{
}
else
{
const
char
*
p
;
const
char
*
p
;
p
=
cgroup_ops
->
get_limit
ing
_cgroup
(
cgroup_ops
,
controllers_list
[
0
]);
p
=
cgroup_ops
->
get_limit_cgroup
(
cgroup_ops
,
controllers_list
[
0
]);
if
(
!
p
)
if
(
!
p
)
return
log_error_errno
(
-
ENOENT
,
ENOENT
,
"Failed to retrieve limit
ing
cgroup path for %s"
,
controllers_list
[
0
]
?:
"(null)"
);
return
log_error_errno
(
-
ENOENT
,
ENOENT
,
"Failed to retrieve limit cgroup path for %s"
,
controllers_list
[
0
]
?:
"(null)"
);
cgroup_base_path
=
strdup
(
p
);
cgroup_base_path
=
strdup
(
p
);
if
(
!
cgroup_base_path
)
if
(
!
cgroup_base_path
)
return
log_error_errno
(
-
ENOMEM
,
ENOMEM
,
"Failed to duplicate limit
ing
cgroup path"
);
return
log_error_errno
(
-
ENOMEM
,
ENOMEM
,
"Failed to duplicate limit cgroup path"
);
}
}
tmp
=
lxc_deslashify
(
cgroup_base_path
);
tmp
=
lxc_deslashify
(
cgroup_base_path
);
...
@@ -393,9 +393,9 @@ static int exec_criu(struct cgroup_ops *cgroup_ops, struct lxc_conf *conf,
...
@@ -393,9 +393,9 @@ static int exec_criu(struct cgroup_ops *cgroup_ops, struct lxc_conf *conf,
DECLARE_ARG
(
"-t"
);
DECLARE_ARG
(
"-t"
);
DECLARE_ARG
(
init_pid_str
);
DECLARE_ARG
(
init_pid_str
);
freezer_relative
=
lxc_cmd_get_limit
ing
_cgroup_path
(
opts
->
c
->
name
,
freezer_relative
=
lxc_cmd_get_limit_cgroup_path
(
opts
->
c
->
name
,
opts
->
c
->
config_path
,
opts
->
c
->
config_path
,
"freezer"
);
"freezer"
);
if
(
!
freezer_relative
)
if
(
!
freezer_relative
)
return
log_error_errno
(
-
ENOENT
,
ENOENT
,
"Failed getting freezer path"
);
return
log_error_errno
(
-
ENOENT
,
ENOENT
,
"Failed getting freezer path"
);
...
...
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