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
4357db9a
Commit
4357db9a
authored
Jan 21, 2010
by
Michel Normand
Committed by
Daniel Lezcano
Jan 21, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add --define to restart V2
Signed-off-by:
Cedric Le Goater
<
clg@fr.ibm.com
>
Signed-off-by:
Daniel Lezcano
<
dlezcano@fr.ibm.com
>
parent
b75afd90
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
1 deletion
+11
-1
lxc_restart.c
src/lxc/lxc_restart.c
+11
-1
No files found.
src/lxc/lxc_restart.c
View file @
4357db9a
...
@@ -37,6 +37,8 @@
...
@@ -37,6 +37,8 @@
lxc_log_define
(
lxc_restart_ui
,
lxc_restart
);
lxc_log_define
(
lxc_restart_ui
,
lxc_restart
);
static
struct
lxc_list
defines
;
static
int
my_checker
(
const
struct
lxc_arguments
*
args
)
static
int
my_checker
(
const
struct
lxc_arguments
*
args
)
{
{
if
(
!
args
->
statefile
)
{
if
(
!
args
->
statefile
)
{
...
@@ -53,6 +55,7 @@ static int my_parser(struct lxc_arguments* args, int c, char* arg)
...
@@ -53,6 +55,7 @@ static int my_parser(struct lxc_arguments* args, int c, char* arg)
case
'd'
:
args
->
statefile
=
arg
;
break
;
case
'd'
:
args
->
statefile
=
arg
;
break
;
case
'f'
:
args
->
rcfile
=
arg
;
break
;
case
'f'
:
args
->
rcfile
=
arg
;
break
;
case
'p'
:
args
->
flags
=
LXC_FLAG_PAUSE
;
break
;
case
'p'
:
args
->
flags
=
LXC_FLAG_PAUSE
;
break
;
case
's'
:
return
lxc_config_define_add
(
&
defines
,
arg
);
}
}
return
0
;
return
0
;
...
@@ -62,6 +65,7 @@ static const struct option my_longopts[] = {
...
@@ -62,6 +65,7 @@ static const struct option my_longopts[] = {
{
"directory"
,
required_argument
,
0
,
'd'
},
{
"directory"
,
required_argument
,
0
,
'd'
},
{
"rcfile"
,
required_argument
,
0
,
'f'
},
{
"rcfile"
,
required_argument
,
0
,
'f'
},
{
"pause"
,
no_argument
,
0
,
'p'
},
{
"pause"
,
no_argument
,
0
,
'p'
},
{
"define"
,
required_argument
,
0
,
's'
},
LXC_COMMON_OPTIONS
LXC_COMMON_OPTIONS
};
};
...
@@ -76,7 +80,8 @@ Options :\n\
...
@@ -76,7 +80,8 @@ Options :\n\
-n, --name=NAME NAME for name of the container
\n
\
-n, --name=NAME NAME for name of the container
\n
\
-p, --pause do not release the container after the restart
\n
\
-p, --pause do not release the container after the restart
\n
\
-d, --directory=STATEFILE for name of statefile
\n
\
-d, --directory=STATEFILE for name of statefile
\n
\
-f, --rcfile=FILE Load configuration file FILE
\n
"
,
-f, --rcfile=FILE Load configuration file FILE
\n
\
-s, --define KEY=VAL Assign VAL to configuration variable KEY
\n
"
,
.
options
=
my_longopts
,
.
options
=
my_longopts
,
.
parser
=
my_parser
,
.
parser
=
my_parser
,
.
checker
=
my_checker
,
.
checker
=
my_checker
,
...
@@ -87,6 +92,8 @@ int main(int argc, char *argv[])
...
@@ -87,6 +92,8 @@ int main(int argc, char *argv[])
char
*
rcfile
=
NULL
;
char
*
rcfile
=
NULL
;
struct
lxc_conf
*
conf
;
struct
lxc_conf
*
conf
;
lxc_list_init
(
&
defines
);
if
(
lxc_arguments_parse
(
&
my_args
,
argc
,
argv
))
if
(
lxc_arguments_parse
(
&
my_args
,
argc
,
argv
))
return
-
1
;
return
-
1
;
...
@@ -121,6 +128,9 @@ int main(int argc, char *argv[])
...
@@ -121,6 +128,9 @@ int main(int argc, char *argv[])
return
-
1
;
return
-
1
;
}
}
if
(
lxc_config_define_load
(
&
defines
,
conf
))
return
-
1
;
return
lxc_restart
(
my_args
.
name
,
my_args
.
statefile
,
conf
,
return
lxc_restart
(
my_args
.
name
,
my_args
.
statefile
,
conf
,
my_args
.
flags
);
my_args
.
flags
);
}
}
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