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
893c6f54
Commit
893c6f54
authored
Oct 06, 2008
by
dlezcano
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Freeze/unfreeze when checkpointing, stop the container when specified with '-s' option
parent
975878a9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
2 deletions
+27
-2
lxc_checkpoint.c
src/lxc/lxc_checkpoint.c
+27
-2
No files found.
src/lxc/lxc_checkpoint.c
View file @
893c6f54
...
...
@@ -38,13 +38,18 @@ int main(int argc, char *argv[])
{
char
opt
;
char
*
name
=
NULL
;
int
stop
=
0
;
int
nbargs
=
0
;
int
ret
=
1
;
while
((
opt
=
getopt
(
argc
,
argv
,
"n:"
))
!=
-
1
)
{
while
((
opt
=
getopt
(
argc
,
argv
,
"
s
n:"
))
!=
-
1
)
{
switch
(
opt
)
{
case
'n'
:
name
=
optarg
;
break
;
case
's'
:
stop
=
1
;
break
;
}
nbargs
++
;
...
...
@@ -53,10 +58,30 @@ int main(int argc, char *argv[])
if
(
!
name
)
usage
(
argv
[
0
]);
if
(
lxc_freeze
(
name
))
{
fprintf
(
stderr
,
"failed to freeze '%s'
\n
"
,
name
);
return
-
1
;
}
if
(
lxc_checkpoint
(
name
,
STDOUT_FILENO
,
0
))
{
fprintf
(
stderr
,
"failed to checkpoint %s
\n
"
,
name
);
goto
out
;
}
if
(
stop
)
{
if
(
lxc_stop
(
name
))
{
fprintf
(
stderr
,
"failed to stop '%s'
\n
"
,
name
);
goto
out
;
}
}
ret
=
0
;
out:
if
(
lxc_unfreeze
(
name
))
{
fprintf
(
stderr
,
"failed to unfreeze '%s'
\n
"
,
name
);
return
1
;
}
return
0
;
return
ret
;
}
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