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
6b201d02
Commit
6b201d02
authored
May 28, 2009
by
Daniel Lezcano
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add a statefile directory parameter
add a statefile directory parameter in order to save some lxc informations a checkpoint. Signed-off-by:
Daniel Lezcano
<
dlezcano@fr.ibm.com
>
parent
d7efa8fc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
4 deletions
+15
-4
arguments.h
src/lxc/arguments.h
+1
-0
lxc_checkpoint.c
src/lxc/lxc_checkpoint.c
+14
-4
No files found.
src/lxc/arguments.h
View file @
6b201d02
...
...
@@ -43,6 +43,7 @@ struct lxc_arguments {
char
*
log_priority
;
int
quiet
;
const
char
*
rcfile
;
const
char
*
statefile
;
/* for lxc-checkpoint */
int
kill
;
...
...
src/lxc/lxc_checkpoint.c
View file @
6b201d02
...
...
@@ -28,12 +28,15 @@
#include <lxc.h>
#include "arguments.h"
lxc_log_define
(
lxc_checkpoint
,
lxc
);
static
int
my_checker
(
const
struct
lxc_arguments
*
args
)
{
if
(
!
args
->
argc
)
{
lxc_error
(
args
,
"
missing STATEFILE filename !
"
);
if
(
!
args
->
statefile
)
{
lxc_error
(
args
,
"
no statefile specified
"
);
return
-
1
;
}
return
0
;
}
...
...
@@ -42,6 +45,7 @@ static int my_parser(struct lxc_arguments* args, int c, char* arg)
switch
(
c
)
{
case
'k'
:
args
->
kill
=
1
;
break
;
case
'p'
:
args
->
pause
=
1
;
break
;
case
'd'
:
args
->
statefile
=
arg
;
break
;
}
return
0
;
}
...
...
@@ -49,6 +53,7 @@ static int my_parser(struct lxc_arguments* args, int c, char* arg)
static
const
struct
option
my_longopts
[]
=
{
{
"kill"
,
no_argument
,
0
,
'k'
},
{
"pause"
,
no_argument
,
0
,
'p'
},
{
"directory"
,
required_argument
,
0
,
'd'
},
LXC_COMMON_OPTIONS
};
...
...
@@ -62,7 +67,8 @@ lxc-checkpoint checkpoints in STATEFILE file the NAME container\n\
Options :
\n
\
-n, --name=NAME NAME for name of the container
\n
\
-k, --kill stop the container after checkpoint
\n
\
-p, --pause don't unfreeze the container after the checkpoint
\n
"
,
-p, --pause don't unfreeze the container after the checkpoint
\n
\
-d, --directory directory to store the statefile
\n
"
,
.
options
=
my_longopts
,
.
parser
=
my_parser
,
...
...
@@ -85,8 +91,12 @@ int main(int argc, char *argv[])
return
ret
;
ret
=
lxc_checkpoint
(
my_args
.
name
,
-
1
,
0
);
if
(
ret
)
if
(
ret
)
{
ERROR
(
"failed to checkpoint '%s'"
,
my_args
.
name
);
return
ret
;
}
INFO
(
"'%s' checkpointed"
,
my_args
.
name
);
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