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
ae2d267e
Unverified
Commit
ae2d267e
authored
Feb 10, 2021
by
Stéphane Graber
Committed by
GitHub
Feb 10, 2021
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3663 from brauner/2021-02-10/fixes
criu: fixes
parents
11a3696f
d9fc9be8
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
24 additions
and
22 deletions
+24
-22
cgfsng.c
src/lxc/cgroups/cgfsng.c
+8
-7
cgroup.h
src/lxc/cgroups/cgroup.h
+3
-3
conf.c
src/lxc/conf.c
+7
-6
criu.c
src/lxc/criu.c
+0
-0
macro.h
src/lxc/macro.h
+0
-6
memory_utils.h
src/lxc/memory_utils.h
+6
-0
No files found.
src/lxc/cgroups/cgfsng.c
View file @
ae2d267e
...
@@ -2018,7 +2018,7 @@ __cgfsng_ops static bool cgfsng_mount(struct cgroup_ops *ops,
...
@@ -2018,7 +2018,7 @@ __cgfsng_ops static bool cgfsng_mount(struct cgroup_ops *ops,
}
}
/* Only root needs to escape to the cgroup of its init. */
/* Only root needs to escape to the cgroup of its init. */
__cgfsng_ops
static
bool
cgfsng_escape
(
const
struct
cgroup_ops
*
ops
,
__cgfsng_ops
static
bool
cgfsng_
criu_
escape
(
const
struct
cgroup_ops
*
ops
,
struct
lxc_conf
*
conf
)
struct
lxc_conf
*
conf
)
{
{
if
(
!
ops
)
if
(
!
ops
)
...
@@ -2049,7 +2049,7 @@ __cgfsng_ops static bool cgfsng_escape(const struct cgroup_ops *ops,
...
@@ -2049,7 +2049,7 @@ __cgfsng_ops static bool cgfsng_escape(const struct cgroup_ops *ops,
return
true
;
return
true
;
}
}
__cgfsng_ops
static
int
cgfsng_num_hierarchies
(
struct
cgroup_ops
*
ops
)
__cgfsng_ops
static
int
cgfsng_
criu_
num_hierarchies
(
struct
cgroup_ops
*
ops
)
{
{
int
i
=
0
;
int
i
=
0
;
...
@@ -2065,8 +2065,8 @@ __cgfsng_ops static int cgfsng_num_hierarchies(struct cgroup_ops *ops)
...
@@ -2065,8 +2065,8 @@ __cgfsng_ops static int cgfsng_num_hierarchies(struct cgroup_ops *ops)
return
i
;
return
i
;
}
}
__cgfsng_ops
static
bool
cgfsng_
get_hierarchies
(
struct
cgroup_ops
*
ops
,
int
n
,
__cgfsng_ops
static
bool
cgfsng_
criu_get_hierarchies
(
struct
cgroup_ops
*
ops
,
char
***
out
)
int
n
,
char
***
out
)
{
{
int
i
;
int
i
;
...
@@ -3516,9 +3516,6 @@ struct cgroup_ops *cgfsng_ops_init(struct lxc_conf *conf)
...
@@ -3516,9 +3516,6 @@ struct cgroup_ops *cgfsng_ops_init(struct lxc_conf *conf)
cgfsng_ops
->
payload_create
=
cgfsng_payload_create
;
cgfsng_ops
->
payload_create
=
cgfsng_payload_create
;
cgfsng_ops
->
payload_enter
=
cgfsng_payload_enter
;
cgfsng_ops
->
payload_enter
=
cgfsng_payload_enter
;
cgfsng_ops
->
payload_finalize
=
cgfsng_payload_finalize
;
cgfsng_ops
->
payload_finalize
=
cgfsng_payload_finalize
;
cgfsng_ops
->
escape
=
cgfsng_escape
;
cgfsng_ops
->
num_hierarchies
=
cgfsng_num_hierarchies
;
cgfsng_ops
->
get_hierarchies
=
cgfsng_get_hierarchies
;
cgfsng_ops
->
get_cgroup
=
cgfsng_get_cgroup
;
cgfsng_ops
->
get_cgroup
=
cgfsng_get_cgroup
;
cgfsng_ops
->
get
=
cgfsng_get
;
cgfsng_ops
->
get
=
cgfsng_get
;
cgfsng_ops
->
set
=
cgfsng_set
;
cgfsng_ops
->
set
=
cgfsng_set
;
...
@@ -3534,6 +3531,10 @@ struct cgroup_ops *cgfsng_ops_init(struct lxc_conf *conf)
...
@@ -3534,6 +3531,10 @@ struct cgroup_ops *cgfsng_ops_init(struct lxc_conf *conf)
cgfsng_ops
->
devices_activate
=
cgfsng_devices_activate
;
cgfsng_ops
->
devices_activate
=
cgfsng_devices_activate
;
cgfsng_ops
->
get_limiting_cgroup
=
cgfsng_get_limiting_cgroup
;
cgfsng_ops
->
get_limiting_cgroup
=
cgfsng_get_limiting_cgroup
;
cgfsng_ops
->
criu_escape
=
cgfsng_criu_escape
;
cgfsng_ops
->
criu_num_hierarchies
=
cgfsng_criu_num_hierarchies
;
cgfsng_ops
->
criu_get_hierarchies
=
cgfsng_criu_get_hierarchies
;
return
move_ptr
(
cgfsng_ops
);
return
move_ptr
(
cgfsng_ops
);
}
}
...
...
src/lxc/cgroups/cgroup.h
View file @
ae2d267e
...
@@ -157,9 +157,9 @@ struct cgroup_ops {
...
@@ -157,9 +157,9 @@ struct cgroup_ops {
bool
(
*
payload_create
)(
struct
cgroup_ops
*
ops
,
struct
lxc_handler
*
handler
);
bool
(
*
payload_create
)(
struct
cgroup_ops
*
ops
,
struct
lxc_handler
*
handler
);
bool
(
*
payload_enter
)(
struct
cgroup_ops
*
ops
,
struct
lxc_handler
*
handler
);
bool
(
*
payload_enter
)(
struct
cgroup_ops
*
ops
,
struct
lxc_handler
*
handler
);
const
char
*
(
*
get_cgroup
)(
struct
cgroup_ops
*
ops
,
const
char
*
controller
);
const
char
*
(
*
get_cgroup
)(
struct
cgroup_ops
*
ops
,
const
char
*
controller
);
bool
(
*
escape
)(
const
struct
cgroup_ops
*
ops
,
struct
lxc_conf
*
conf
);
bool
(
*
criu_
escape
)(
const
struct
cgroup_ops
*
ops
,
struct
lxc_conf
*
conf
);
int
(
*
num_hierarchies
)(
struct
cgroup_ops
*
ops
);
int
(
*
criu_
num_hierarchies
)(
struct
cgroup_ops
*
ops
);
bool
(
*
get_hierarchies
)(
struct
cgroup_ops
*
ops
,
int
n
,
char
***
out
);
bool
(
*
criu_
get_hierarchies
)(
struct
cgroup_ops
*
ops
,
int
n
,
char
***
out
);
int
(
*
set
)(
struct
cgroup_ops
*
ops
,
const
char
*
filename
,
int
(
*
set
)(
struct
cgroup_ops
*
ops
,
const
char
*
filename
,
const
char
*
value
,
const
char
*
name
,
const
char
*
lxcpath
);
const
char
*
value
,
const
char
*
name
,
const
char
*
lxcpath
);
int
(
*
get
)(
struct
cgroup_ops
*
ops
,
const
char
*
filename
,
char
*
value
,
int
(
*
get
)(
struct
cgroup_ops
*
ops
,
const
char
*
filename
,
char
*
value
,
...
...
src/lxc/conf.c
View file @
ae2d267e
...
@@ -911,22 +911,23 @@ static int lxc_setup_ttys(struct lxc_conf *conf)
...
@@ -911,22 +911,23 @@ static int lxc_setup_ttys(struct lxc_conf *conf)
return
0
;
return
0
;
}
}
define_cleanup_function
(
struct
lxc_tty_info
*
,
lxc_delete_tty
);
static
int
lxc_allocate_ttys
(
struct
lxc_conf
*
conf
)
static
int
lxc_allocate_ttys
(
struct
lxc_conf
*
conf
)
{
{
struct
lxc_terminal_info
*
tty_new
=
NULL
;
call_cleaner
(
lxc_delete_tty
)
struct
lxc_tty_info
*
ttys
=
&
conf
->
ttys
;
int
ret
;
int
ret
;
struct
lxc_tty_info
*
ttys
=
&
conf
->
ttys
;
/* no tty in the configuration */
/* no tty in the configuration */
if
(
ttys
->
max
==
0
)
if
(
ttys
->
max
==
0
)
return
0
;
return
0
;
tty
_new
=
m
alloc
(
sizeof
(
struct
lxc_terminal_info
)
*
ttys
->
max
);
tty
s
->
tty
=
z
alloc
(
sizeof
(
struct
lxc_terminal_info
)
*
ttys
->
max
);
if
(
!
tty
_new
)
if
(
!
tty
s
->
tty
)
return
-
ENOMEM
;
return
-
ENOMEM
;
for
(
size_t
i
=
0
;
i
<
conf
->
ttys
.
max
;
i
++
)
{
for
(
size_t
i
=
0
;
i
<
conf
->
ttys
.
max
;
i
++
)
{
struct
lxc_terminal_info
*
tty
=
&
tty
_new
[
i
];
struct
lxc_terminal_info
*
tty
=
&
tty
s
->
tty
[
i
];
tty
->
ptx
=
-
EBADF
;
tty
->
ptx
=
-
EBADF
;
tty
->
pty
=
-
EBADF
;
tty
->
pty
=
-
EBADF
;
...
@@ -959,7 +960,7 @@ static int lxc_allocate_ttys(struct lxc_conf *conf)
...
@@ -959,7 +960,7 @@ static int lxc_allocate_ttys(struct lxc_conf *conf)
}
}
INFO
(
"Finished creating %zu tty devices"
,
ttys
->
max
);
INFO
(
"Finished creating %zu tty devices"
,
ttys
->
max
);
conf
->
ttys
.
tty
=
move_ptr
(
tty_new
);
move_ptr
(
ttys
);
return
0
;
return
0
;
}
}
...
...
src/lxc/criu.c
View file @
ae2d267e
This diff is collapsed.
Click to expand it.
src/lxc/macro.h
View file @
ae2d267e
...
@@ -644,12 +644,6 @@ enum {
...
@@ -644,12 +644,6 @@ enum {
-(__errno__); \
-(__errno__); \
})
})
#define free_move_ptr(a, b) \
({ \
free(a); \
(a) = move_ptr((b)); \
})
/* Container's specific file/directory names */
/* Container's specific file/directory names */
#define LXC_CONFIG_FNAME "config"
#define LXC_CONFIG_FNAME "config"
#define LXC_PARTIAL_FNAME "partial"
#define LXC_PARTIAL_FNAME "partial"
...
...
src/lxc/memory_utils.h
View file @
ae2d267e
...
@@ -83,4 +83,10 @@ static inline void *memdup(const void *data, size_t len)
...
@@ -83,4 +83,10 @@ static inline void *memdup(const void *data, size_t len)
#define zalloc(__size__) (calloc(1, __size__))
#define zalloc(__size__) (calloc(1, __size__))
#define free_move_ptr(a, b) \
({ \
free(a); \
(a) = move_ptr((b)); \
})
#endif
/* __LXC_MEMORY_UTILS_H */
#endif
/* __LXC_MEMORY_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