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
67c933b6
Commit
67c933b6
authored
Nov 16, 2016
by
Christian Brauner
Committed by
GitHub
Nov 16, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1303 from adrianreber/master
lxc-checkpoint: automatically detect if --external or --veth-pair
parents
471a304d
46c8ffd5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
5 deletions
+32
-5
criu.c
src/lxc/criu.c
+32
-5
No files found.
src/lxc/criu.c
View file @
67c933b6
...
...
@@ -58,6 +58,7 @@
#define CRIU_GITID_PATCHLEVEL 0
#define CRIU_IN_FLIGHT_SUPPORT "2.4"
#define CRIU_EXTERNAL_NOT_VETH "2.8"
lxc_log_define
(
lxc_criu
,
lxc
);
...
...
@@ -482,7 +483,19 @@ static void exec_criu(struct criu_opts *opts)
lxc_list_for_each
(
it
,
&
opts
->
c
->
lxc_conf
->
network
)
{
char
eth
[
128
],
*
veth
;
char
*
fmt
;
struct
lxc_netdev
*
n
=
it
->
elem
;
bool
external_not_veth
;
if
(
strcmp
(
opts
->
criu_version
,
CRIU_EXTERNAL_NOT_VETH
)
>=
0
)
{
/* Since criu version 2.8 the usage of --veth-pair
* has been deprecated:
* git tag --contains f2037e6d3445fc400
* v2.8 */
external_not_veth
=
true
;
}
else
{
external_not_veth
=
false
;
}
if
(
n
->
name
)
{
if
(
strlen
(
n
->
name
)
>=
sizeof
(
eth
))
...
...
@@ -498,10 +511,21 @@ static void exec_criu(struct criu_opts *opts)
case
LXC_NET_VETH
:
veth
=
n
->
priv
.
veth_attr
.
pair
;
if
(
n
->
link
)
ret
=
snprintf
(
buf
,
sizeof
(
buf
),
"veth[%s]:%s@%s"
,
eth
,
veth
,
n
->
link
);
else
ret
=
snprintf
(
buf
,
sizeof
(
buf
),
"veth[%s]:%s"
,
eth
,
veth
);
if
(
n
->
link
)
{
if
(
external_not_veth
)
fmt
=
"veth[%s]:%s@%s"
;
else
fmt
=
"%s=%s@%s"
;
ret
=
snprintf
(
buf
,
sizeof
(
buf
),
fmt
,
eth
,
veth
,
n
->
link
);
}
else
{
if
(
external_not_veth
)
fmt
=
"veth[%s]:%s"
;
else
fmt
=
"%s=%s"
;
ret
=
snprintf
(
buf
,
sizeof
(
buf
),
fmt
,
eth
,
veth
);
}
if
(
ret
<
0
||
ret
>=
sizeof
(
buf
))
goto
err
;
break
;
...
...
@@ -524,7 +548,10 @@ static void exec_criu(struct criu_opts *opts)
goto
err
;
}
DECLARE_ARG
(
"--external"
);
if
(
external_not_veth
)
DECLARE_ARG
(
"--external"
);
else
DECLARE_ARG
(
"--veth-pair"
);
DECLARE_ARG
(
buf
);
netnr
++
;
}
...
...
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