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
a753a7a9
Commit
a753a7a9
authored
Sep 04, 2017
by
Stéphane Graber
Committed by
GitHub
Sep 04, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1783 from brauner/2017-09-04/criu_version
criu: add cmp_version()
parents
56c2d600
74ad3607
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
1 deletion
+42
-1
criu.c
src/lxc/criu.c
+42
-1
No files found.
src/lxc/criu.c
View file @
a753a7a9
...
@@ -126,6 +126,47 @@ static int load_tty_major_minor(char *directory, char *output, int len)
...
@@ -126,6 +126,47 @@ static int load_tty_major_minor(char *directory, char *output, int len)
return
0
;
return
0
;
}
}
static
int
cmp_version
(
const
char
*
v1
,
const
char
*
v2
)
{
int
ret
;
int
oct_v1
[
3
],
oct_v2
[
3
];
memset
(
oct_v1
,
-
1
,
sizeof
(
oct_v1
));
memset
(
oct_v2
,
-
1
,
sizeof
(
oct_v2
));
ret
=
sscanf
(
v1
,
"%d.%d.%d"
,
&
oct_v1
[
0
],
&
oct_v1
[
1
],
&
oct_v1
[
2
]);
if
(
ret
<
1
)
return
-
1
;
ret
=
sscanf
(
v2
,
"%d.%d.%d"
,
&
oct_v2
[
0
],
&
oct_v2
[
1
],
&
oct_v2
[
2
]);
if
(
ret
<
1
)
return
-
1
;
/* Major version is greater. */
if
(
oct_v1
[
0
]
>
oct_v2
[
0
])
return
1
;
if
(
oct_v1
[
0
]
<
oct_v2
[
0
])
return
-
1
;
/* Minor number is greater.*/
if
(
oct_v1
[
1
]
>
oct_v2
[
1
])
return
1
;
if
(
oct_v1
[
1
]
<
oct_v2
[
1
])
return
-
1
;
/* Patch number is greater. */
if
(
oct_v1
[
2
]
>
oct_v2
[
2
])
return
1
;
/* Patch numbers are equal. */
if
(
oct_v1
[
2
]
==
oct_v2
[
2
])
return
0
;
return
-
1
;
}
static
void
exec_criu
(
struct
criu_opts
*
opts
)
static
void
exec_criu
(
struct
criu_opts
*
opts
)
{
{
char
**
argv
,
log
[
PATH_MAX
];
char
**
argv
,
log
[
PATH_MAX
];
...
@@ -500,7 +541,7 @@ static void exec_criu(struct criu_opts *opts)
...
@@ -500,7 +541,7 @@ static void exec_criu(struct criu_opts *opts)
struct
lxc_netdev
*
n
=
it
->
elem
;
struct
lxc_netdev
*
n
=
it
->
elem
;
bool
external_not_veth
;
bool
external_not_veth
;
if
(
strcmp
(
opts
->
criu_version
,
CRIU_EXTERNAL_NOT_VETH
)
>=
0
)
{
if
(
cmp_version
(
opts
->
criu_version
,
CRIU_EXTERNAL_NOT_VETH
)
>=
0
)
{
/* Since criu version 2.8 the usage of --veth-pair
/* Since criu version 2.8 the usage of --veth-pair
* has been deprecated:
* has been deprecated:
* git tag --contains f2037e6d3445fc400
* git tag --contains f2037e6d3445fc400
...
...
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