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
25c2aca5
Commit
25c2aca5
authored
Nov 17, 2009
by
Michel Normand
Committed by
Daniel Lezcano
Nov 17, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
export set_state function
This function will be needed for the restart function. Signed-off-by:
Michel Normand
<
normand@fr.ibm.com
>
Signed-off-by:
Daniel Lezcano
<
dlezcano@fr.ibm.com
>
parent
bcc23654
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
7 deletions
+8
-7
start.c
src/lxc/start.c
+7
-7
start.h
src/lxc/start.h
+1
-0
No files found.
src/lxc/start.c
View file @
25c2aca5
...
@@ -147,7 +147,7 @@ static int sigchld_handler(int fd, void *data,
...
@@ -147,7 +147,7 @@ static int sigchld_handler(int fd, void *data,
return
1
;
return
1
;
}
}
static
int
set_state
(
const
char
*
name
,
struct
lxc_handler
*
handler
,
lxc_state_t
state
)
int
lxc_
set_state
(
const
char
*
name
,
struct
lxc_handler
*
handler
,
lxc_state_t
state
)
{
{
handler
->
state
=
state
;
handler
->
state
=
state
;
lxc_monitor_send_state
(
name
,
state
);
lxc_monitor_send_state
(
name
,
state
);
...
@@ -241,7 +241,7 @@ struct lxc_handler *lxc_init(const char *name, const char *rcfile)
...
@@ -241,7 +241,7 @@ struct lxc_handler *lxc_init(const char *name, const char *rcfile)
memset
(
handler
,
0
,
sizeof
(
*
handler
));
memset
(
handler
,
0
,
sizeof
(
*
handler
));
/* Begin the set the state to STARTING*/
/* Begin the set the state to STARTING*/
if
(
set_state
(
name
,
handler
,
STARTING
))
{
if
(
lxc_
set_state
(
name
,
handler
,
STARTING
))
{
ERROR
(
"failed to set state '%s'"
,
lxc_state2str
(
STARTING
));
ERROR
(
"failed to set state '%s'"
,
lxc_state2str
(
STARTING
));
goto
out_free
;
goto
out_free
;
}
}
...
@@ -296,7 +296,7 @@ out:
...
@@ -296,7 +296,7 @@ out:
out_delete_tty:
out_delete_tty:
lxc_delete_tty
(
&
handler
->
conf
.
tty_info
);
lxc_delete_tty
(
&
handler
->
conf
.
tty_info
);
out_aborting:
out_aborting:
set_state
(
name
,
handler
,
ABORTING
);
lxc_
set_state
(
name
,
handler
,
ABORTING
);
out_free:
out_free:
free
(
handler
);
free
(
handler
);
handler
=
NULL
;
handler
=
NULL
;
...
@@ -308,8 +308,8 @@ void lxc_fini(const char *name, struct lxc_handler *handler)
...
@@ -308,8 +308,8 @@ void lxc_fini(const char *name, struct lxc_handler *handler)
/* The STOPPING state is there for future cleanup code
/* The STOPPING state is there for future cleanup code
* which can take awhile
* which can take awhile
*/
*/
set_state
(
name
,
handler
,
STOPPING
);
lxc_
set_state
(
name
,
handler
,
STOPPING
);
set_state
(
name
,
handler
,
STOPPED
);
lxc_
set_state
(
name
,
handler
,
STOPPED
);
lxc_unlink_nsgroup
(
name
);
lxc_unlink_nsgroup
(
name
);
if
(
handler
)
{
if
(
handler
)
{
...
@@ -323,7 +323,7 @@ void lxc_fini(const char *name, struct lxc_handler *handler)
...
@@ -323,7 +323,7 @@ void lxc_fini(const char *name, struct lxc_handler *handler)
void
lxc_abort
(
const
char
*
name
,
struct
lxc_handler
*
handler
)
void
lxc_abort
(
const
char
*
name
,
struct
lxc_handler
*
handler
)
{
{
set_state
(
name
,
handler
,
ABORTING
);
lxc_
set_state
(
name
,
handler
,
ABORTING
);
kill
(
handler
->
pid
,
SIGKILL
);
kill
(
handler
->
pid
,
SIGKILL
);
}
}
...
@@ -465,7 +465,7 @@ int lxc_spawn(const char *name, struct lxc_handler *handler, char *const argv[])
...
@@ -465,7 +465,7 @@ int lxc_spawn(const char *name, struct lxc_handler *handler, char *const argv[])
goto
out_abort
;
goto
out_abort
;
}
}
if
(
set_state
(
name
,
handler
,
RUNNING
))
{
if
(
lxc_
set_state
(
name
,
handler
,
RUNNING
))
{
ERROR
(
"failed to set state to %s"
,
ERROR
(
"failed to set state to %s"
,
lxc_state2str
(
RUNNING
));
lxc_state2str
(
RUNNING
));
goto
out_abort
;
goto
out_abort
;
...
...
src/lxc/start.h
View file @
25c2aca5
...
@@ -44,6 +44,7 @@ extern int lxc_spawn(const char *name, struct lxc_handler *handler,
...
@@ -44,6 +44,7 @@ extern int lxc_spawn(const char *name, struct lxc_handler *handler,
extern
int
lxc_poll
(
const
char
*
name
,
struct
lxc_handler
*
handler
);
extern
int
lxc_poll
(
const
char
*
name
,
struct
lxc_handler
*
handler
);
extern
void
lxc_abort
(
const
char
*
name
,
struct
lxc_handler
*
handler
);
extern
void
lxc_abort
(
const
char
*
name
,
struct
lxc_handler
*
handler
);
extern
void
lxc_fini
(
const
char
*
name
,
struct
lxc_handler
*
handler
);
extern
void
lxc_fini
(
const
char
*
name
,
struct
lxc_handler
*
handler
);
extern
int
lxc_set_state
(
const
char
*
,
struct
lxc_handler
*
,
lxc_state_t
);
#endif
#endif
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