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
3bdf52d7
Commit
3bdf52d7
authored
Apr 08, 2010
by
Daniel Lezcano
Committed by
Daniel Lezcano
Apr 08, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Store the container name in the handler
Store the container in the handler, so it is accessible everywhere. Signed-off-by:
Daniel Lezcano
<
dlezcan@fr.ibm.com
>
parent
e0f888d9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
1 deletion
+12
-1
start.c
src/lxc/start.c
+11
-1
start.h
src/lxc/start.h
+1
-0
No files found.
src/lxc/start.c
View file @
3bdf52d7
...
...
@@ -279,10 +279,16 @@ struct lxc_handler *lxc_init(const char *name, struct lxc_conf *conf)
handler
->
conf
=
conf
;
handler
->
name
=
strdup
(
name
);
if
(
!
handler
->
name
)
{
ERROR
(
"failed to allocate memory"
);
goto
out_free
;
}
/* Begin the set the state to STARTING*/
if
(
lxc_set_state
(
name
,
handler
,
STARTING
))
{
ERROR
(
"failed to set state '%s'"
,
lxc_state2str
(
STARTING
));
goto
out_free
;
goto
out_free
_name
;
}
if
(
lxc_create_tty
(
name
,
conf
))
{
...
...
@@ -317,6 +323,9 @@ out_delete_tty:
lxc_delete_tty
(
&
conf
->
tty_info
);
out_aborting:
lxc_set_state
(
name
,
handler
,
ABORTING
);
out_free_name:
free
(
handler
->
name
);
handler
->
name
=
NULL
;
out_free:
free
(
handler
);
return
NULL
;
...
...
@@ -333,6 +342,7 @@ void lxc_fini(const char *name, struct lxc_handler *handler)
lxc_delete_console
(
&
handler
->
conf
->
console
);
lxc_delete_tty
(
&
handler
->
conf
->
tty_info
);
free
(
handler
->
name
);
free
(
handler
);
LXC_TTY_DEL_HANDLER
(
SIGQUIT
);
...
...
src/lxc/start.h
View file @
3bdf52d7
...
...
@@ -30,6 +30,7 @@ struct lxc_conf;
struct
lxc_handler
{
pid_t
pid
;
char
*
name
;
lxc_state_t
state
;
int
sigfd
;
char
nsgroup
[
MAXPATHLEN
];
...
...
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