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
426b9f61
Unverified
Commit
426b9f61
authored
Oct 11, 2018
by
Christian Brauner
Committed by
GitHub
Oct 11, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2690 from adrianreber/master
checkpoint: fix running do_dump()
parents
d354a97d
e20f46f8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
10 deletions
+6
-10
criu.c
src/lxc/criu.c
+6
-10
No files found.
src/lxc/criu.c
View file @
426b9f61
...
...
@@ -174,7 +174,8 @@ static int cmp_version(const char *v1, const char *v2)
return
-
1
;
}
static
void
exec_criu
(
struct
cgroup_ops
*
cgroup_ops
,
struct
criu_opts
*
opts
)
static
void
exec_criu
(
struct
cgroup_ops
*
cgroup_ops
,
struct
lxc_conf
*
conf
,
struct
criu_opts
*
opts
)
{
char
**
argv
,
log
[
PATH_MAX
];
int
static_args
=
23
,
argc
=
0
,
i
,
ret
;
...
...
@@ -193,7 +194,7 @@ static void exec_criu(struct cgroup_ops *cgroup_ops, struct criu_opts *opts)
* /actual/ root cgroup so that lxcfs thinks criu has enough rights to
* see all cgroups.
*/
if
(
!
cgroup_ops
->
escape
(
cgroup_ops
,
opts
->
handler
->
conf
))
{
if
(
!
cgroup_ops
->
escape
(
cgroup_ops
,
conf
))
{
ERROR
(
"failed to escape cgroups"
);
return
;
}
...
...
@@ -1065,7 +1066,7 @@ static void do_restore(struct lxc_container *c, int status_pipe, struct migrate_
os
.
console_name
=
c
->
lxc_conf
->
console
.
name
;
/* exec_criu() returning is an error */
exec_criu
(
cgroup_ops
,
&
os
);
exec_criu
(
cgroup_ops
,
c
->
lxc_conf
,
&
os
);
umount
(
rootfs
->
mount
);
rmdir
(
rootfs
->
mount
);
goto
out_fini_handler
;
...
...
@@ -1266,22 +1267,16 @@ static bool do_dump(struct lxc_container *c, char *mode, struct migrate_opts *op
if
(
pid
==
0
)
{
struct
criu_opts
os
;
struct
lxc_handler
h
;
struct
cgroup_ops
*
cgroup_ops
;
close
(
criuout
[
0
]);
lxc_zero_handler
(
&
h
);
h
.
name
=
c
->
name
;
cgroup_ops
=
cgroup_init
(
c
->
lxc_conf
);
if
(
!
cgroup_ops
)
{
ERROR
(
"failed to cgroup_init()"
);
_exit
(
EXIT_FAILURE
);
return
-
1
;
}
h
.
cgroup_ops
=
cgroup_ops
;
os
.
pipefd
=
criuout
[
1
];
os
.
action
=
mode
;
...
...
@@ -1289,6 +1284,7 @@ static bool do_dump(struct lxc_container *c, char *mode, struct migrate_opts *op
os
.
c
=
c
;
os
.
console_name
=
c
->
lxc_conf
->
console
.
path
;
os
.
criu_version
=
criu_version
;
os
.
handler
=
NULL
;
ret
=
save_tty_major_minor
(
opts
->
directory
,
c
,
os
.
tty_id
,
sizeof
(
os
.
tty_id
));
if
(
ret
<
0
)
{
...
...
@@ -1297,7 +1293,7 @@ static bool do_dump(struct lxc_container *c, char *mode, struct migrate_opts *op
}
/* exec_criu() returning is an error */
exec_criu
(
cgroup_ops
,
&
os
);
exec_criu
(
cgroup_ops
,
c
->
lxc_conf
,
&
os
);
free
(
criu_version
);
_exit
(
EXIT_FAILURE
);
}
else
{
...
...
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