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
52e12945
Commit
52e12945
authored
Oct 31, 2016
by
Stéphane Graber
Committed by
GitHub
Oct 31, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1266 from tych0/do-mount-rewriting
Do mount rewriting
parents
a99e57fe
ed408e66
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
1 deletion
+41
-1
criu.c
src/lxc/criu.c
+40
-0
log.h
src/lxc/log.h
+1
-1
No files found.
src/lxc/criu.c
View file @
52e12945
...
...
@@ -46,6 +46,12 @@
#include "network.h"
#include "utils.h"
#if IS_BIONIC
#include <../include/lxcmntent.h>
#else
#include <mntent.h>
#endif
#define CRIU_VERSION "2.0"
#define CRIU_GITID_VERSION "2.0"
...
...
@@ -123,6 +129,8 @@ static void exec_criu(struct criu_opts *opts)
int
static_args
=
23
,
argc
=
0
,
i
,
ret
;
int
netnr
=
0
;
struct
lxc_list
*
it
;
FILE
*
mnts
;
struct
mntent
mntent
;
char
buf
[
4096
],
tty_info
[
32
];
size_t
pos
;
...
...
@@ -200,6 +208,8 @@ static void exec_criu(struct criu_opts *opts)
if
(
opts
->
user
->
action_script
)
static_args
+=
2
;
static_args
+=
2
*
lxc_list_len
(
&
opts
->
c
->
lxc_conf
->
mount_list
);
ret
=
snprintf
(
log
,
PATH_MAX
,
"%s/%s.log"
,
opts
->
user
->
directory
,
opts
->
action
);
if
(
ret
<
0
||
ret
>=
PATH_MAX
)
{
ERROR
(
"logfile name too long
\n
"
);
...
...
@@ -315,6 +325,36 @@ static void exec_criu(struct criu_opts *opts)
DECLARE_ARG
(
opts
->
user
->
action_script
);
}
mnts
=
write_mount_file
(
&
opts
->
c
->
lxc_conf
->
mount_list
);
if
(
!
mnts
)
goto
err
;
while
(
getmntent_r
(
mnts
,
&
mntent
,
buf
,
sizeof
(
buf
)))
{
char
*
fmt
,
*
key
,
*
val
;
char
arg
[
2
*
PATH_MAX
+
2
];
if
(
strcmp
(
opts
->
action
,
"dump"
)
==
0
)
{
fmt
=
"/%s:%s"
;
key
=
mntent
.
mnt_dir
;
val
=
mntent
.
mnt_dir
;
}
else
{
fmt
=
"%s:%s"
;
key
=
mntent
.
mnt_dir
;
val
=
mntent
.
mnt_fsname
;
}
ret
=
snprintf
(
arg
,
sizeof
(
arg
),
fmt
,
key
,
val
);
if
(
ret
<
0
||
ret
>=
sizeof
(
arg
))
{
fclose
(
mnts
);
ERROR
(
"snprintf failed"
);
goto
err
;
}
DECLARE_ARG
(
"--ext-mount-map"
);
DECLARE_ARG
(
arg
);
}
fclose
(
mnts
);
if
(
strcmp
(
opts
->
action
,
"dump"
)
==
0
||
strcmp
(
opts
->
action
,
"pre-dump"
)
==
0
)
{
char
pid
[
32
],
*
freezer_relative
;
...
...
src/lxc/log.h
View file @
52e12945
...
...
@@ -46,7 +46,7 @@
#endif
#define LXC_LOG_PREFIX_SIZE 32
#define LXC_LOG_BUFFER_SIZE
1024
#define LXC_LOG_BUFFER_SIZE
4096
/* This attribute is required to silence clang warnings */
#if defined(__GNUC__)
...
...
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