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
f036e5ce
Commit
f036e5ce
authored
Mar 21, 2016
by
Serge Hallyn
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #906 from tych0/fix-console-none-migration
Fix console none migration
parents
ecd852f3
97e4f1a9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
14 deletions
+22
-14
criu.c
src/lxc/criu.c
+22
-14
No files found.
src/lxc/criu.c
View file @
f036e5ce
...
...
@@ -259,9 +259,10 @@ static void exec_criu(struct criu_opts *opts)
DECLARE_ARG
(
"--freeze-cgroup"
);
DECLARE_ARG
(
log
);
DECLARE_ARG
(
"--ext-mount-map"
);
DECLARE_ARG
(
"/dev/console:console"
);
if
(
opts
->
tty_id
[
0
])
{
DECLARE_ARG
(
"--ext-mount-map"
);
DECLARE_ARG
(
"/dev/console:console"
);
DECLARE_ARG
(
"--external"
);
DECLARE_ARG
(
opts
->
tty_id
);
}
...
...
@@ -289,6 +290,11 @@ static void exec_criu(struct criu_opts *opts)
DECLARE_ARG
(
opts
->
cgroup_path
);
if
(
tty_info
[
0
])
{
if
(
opts
->
console_fd
<
0
)
{
ERROR
(
"lxc.console configured on source host but not target"
);
goto
err
;
}
ret
=
snprintf
(
buf
,
sizeof
(
buf
),
"fd[%d]:%s"
,
opts
->
console_fd
,
tty_info
);
if
(
ret
<
0
||
ret
>=
sizeof
(
buf
))
goto
err
;
...
...
@@ -623,20 +629,22 @@ void do_restore(struct lxc_container *c, int status_pipe, char *directory, bool
os
.
cgroup_path
=
cgroup_canonical_path
(
handler
);
os
.
console_fd
=
c
->
lxc_conf
->
console
.
slave
;
/* Twiddle the FD_CLOEXEC bit. We want to pass this FD to criu
* via --inherit-fd, so we don't want it to close.
*/
flags
=
fcntl
(
os
.
console_fd
,
F_GETFD
);
if
(
flags
<
0
)
{
SYSERROR
(
"F_GETFD failed"
);
goto
out_fini_handler
;
}
if
(
os
.
console_fd
>=
0
)
{
/* Twiddle the FD_CLOEXEC bit. We want to pass this FD to criu
* via --inherit-fd, so we don't want it to close.
*/
flags
=
fcntl
(
os
.
console_fd
,
F_GETFD
);
if
(
flags
<
0
)
{
SYSERROR
(
"F_GETFD failed: %d"
,
os
.
console_fd
);
goto
out_fini_handler
;
}
flags
&=
~
FD_CLOEXEC
;
flags
&=
~
FD_CLOEXEC
;
if
(
fcntl
(
os
.
console_fd
,
F_SETFD
,
flags
)
<
0
)
{
SYSERROR
(
"F_SETFD failed"
);
goto
out_fini_handler
;
if
(
fcntl
(
os
.
console_fd
,
F_SETFD
,
flags
)
<
0
)
{
SYSERROR
(
"F_SETFD failed"
);
goto
out_fini_handler
;
}
}
os
.
console_name
=
c
->
lxc_conf
->
console
.
name
;
...
...
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