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
2a061f55
Commit
2a061f55
authored
Dec 14, 2012
by
Daniel Lezcano
Browse files
Options
Browse Files
Download
Plain Diff
Merge
git://github.com/lxc/lxc
parents
d984bb4e
d2e30e99
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
23 additions
and
9 deletions
+23
-9
commands.c
src/lxc/commands.c
+12
-5
commands.h
src/lxc/commands.h
+1
-0
conf.c
src/lxc/conf.c
+1
-0
lxccontainer.c
src/lxc/lxccontainer.c
+0
-3
start.c
src/lxc/start.c
+9
-1
No files found.
src/lxc/commands.c
View file @
2a061f55
...
...
@@ -287,11 +287,9 @@ out_close:
goto
out
;
}
extern
int
lxc_command_mainloop_add
(
const
char
*
name
,
struct
lxc_epoll_descr
*
descr
,
struct
lxc_handler
*
handler
)
extern
int
lxc_command_init
(
const
char
*
name
,
struct
lxc_handler
*
handler
)
{
int
ret
,
fd
;
int
fd
;
char
path
[
sizeof
(((
struct
sockaddr_un
*
)
0
)
->
sun_path
)]
=
{
0
};
char
*
offset
=
&
path
[
1
];
int
rc
,
len
;
...
...
@@ -320,6 +318,16 @@ extern int lxc_command_mainloop_add(const char *name,
return
-
1
;
}
handler
->
conf
->
maincmd_fd
=
fd
;
return
0
;
}
extern
int
lxc_command_mainloop_add
(
const
char
*
name
,
struct
lxc_epoll_descr
*
descr
,
struct
lxc_handler
*
handler
)
{
int
ret
,
fd
=
handler
->
conf
->
maincmd_fd
;
ret
=
lxc_mainloop_add_handler
(
descr
,
fd
,
incoming_command_handler
,
handler
);
if
(
ret
)
{
...
...
@@ -327,6 +335,5 @@ extern int lxc_command_mainloop_add(const char *name,
close
(
fd
);
}
handler
->
conf
->
maincmd_fd
=
fd
;
return
ret
;
}
src/lxc/commands.h
View file @
2a061f55
...
...
@@ -60,6 +60,7 @@ extern int lxc_command_connected(const char *name, struct lxc_command *command,
struct
lxc_epoll_descr
;
struct
lxc_handler
;
extern
int
lxc_command_init
(
const
char
*
name
,
struct
lxc_handler
*
handler
);
extern
int
lxc_command_mainloop_add
(
const
char
*
name
,
struct
lxc_epoll_descr
*
descr
,
struct
lxc_handler
*
handler
);
...
...
src/lxc/conf.c
View file @
2a061f55
...
...
@@ -1895,6 +1895,7 @@ struct lxc_conf *lxc_conf_init(void)
new
->
console
.
master
=
-
1
;
new
->
console
.
slave
=
-
1
;
new
->
console
.
name
[
0
]
=
'\0'
;
new
->
maincmd_fd
=
-
1
;
new
->
rootfs
.
mount
=
default_rootfs_mount
;
new
->
loglevel
=
LXC_LOG_PRIORITY_NOTSET
;
lxc_list_init
(
&
new
->
cgroup
);
...
...
src/lxc/lxccontainer.c
View file @
2a061f55
...
...
@@ -381,9 +381,6 @@ reboot:
if
(
conf
->
reboot
)
{
INFO
(
"container requested reboot"
);
conf
->
reboot
=
0
;
if
(
conf
->
maincmd_fd
)
close
(
conf
->
maincmd_fd
);
conf
->
maincmd_fd
=
0
;
goto
reboot
;
}
...
...
src/lxc/start.c
View file @
2a061f55
...
...
@@ -377,9 +377,12 @@ struct lxc_handler *lxc_init(const char *name, struct lxc_conf *conf)
goto
out_free
;
}
if
(
lxc_command_init
(
name
,
handler
))
goto
out_free_name
;
if
(
lxc_read_seccomp_config
(
conf
)
!=
0
)
{
ERROR
(
"failed loading seccomp policy"
);
goto
out_
free_name
;
goto
out_
close_maincmd_fd
;
}
/* Begin the set the state to STARTING*/
...
...
@@ -421,6 +424,9 @@ out_delete_tty:
lxc_delete_tty
(
&
conf
->
tty_info
);
out_aborting:
lxc_set_state
(
name
,
handler
,
ABORTING
);
out_close_maincmd_fd:
close
(
conf
->
maincmd_fd
);
conf
->
maincmd_fd
=
-
1
;
out_free_name:
free
(
handler
->
name
);
handler
->
name
=
NULL
;
...
...
@@ -446,6 +452,8 @@ void lxc_fini(const char *name, struct lxc_handler *handler)
lxc_delete_console
(
&
handler
->
conf
->
console
);
lxc_delete_tty
(
&
handler
->
conf
->
tty_info
);
close
(
handler
->
conf
->
maincmd_fd
);
handler
->
conf
->
maincmd_fd
=
-
1
;
free
(
handler
->
name
);
free
(
handler
);
}
...
...
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