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
b5ea184f
Unverified
Commit
b5ea184f
authored
Jan 22, 2018
by
LiFeng
Committed by
Christian Brauner
Feb 06, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix comments and add check in lxc_poll.
Add check whether handler->conf->console.path is 'none' Signed-off-by:
LiFeng
<
lifeng68@huawei.com
>
parent
d83e0ffd
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
1 deletion
+13
-1
start.c
src/lxc/start.c
+13
-1
No files found.
src/lxc/start.c
View file @
b5ea184f
...
@@ -485,20 +485,25 @@ int lxc_set_state(const char *name, struct lxc_handler *handler,
...
@@ -485,20 +485,25 @@ int lxc_set_state(const char *name, struct lxc_handler *handler,
int
lxc_poll
(
const
char
*
name
,
struct
lxc_handler
*
handler
)
int
lxc_poll
(
const
char
*
name
,
struct
lxc_handler
*
handler
)
{
{
int
ret
;
int
ret
;
struct
lxc_console
*
console
=
&
handler
->
conf
->
consol
e
;
bool
has_console
=
tru
e
;
struct
lxc_epoll_descr
descr
,
descr_console
;
struct
lxc_epoll_descr
descr
,
descr_console
;
if
(
handler
->
conf
->
console
.
path
&&
!
strcmp
(
handler
->
conf
->
console
.
path
,
"none"
))
has_console
=
false
;
ret
=
lxc_mainloop_open
(
&
descr
);
ret
=
lxc_mainloop_open
(
&
descr
);
if
(
ret
<
0
)
{
if
(
ret
<
0
)
{
ERROR
(
"Failed to create mainloop"
);
ERROR
(
"Failed to create mainloop"
);
goto
out_sigfd
;
goto
out_sigfd
;
}
}
if
(
has_console
)
{
ret
=
lxc_mainloop_open
(
&
descr_console
);
ret
=
lxc_mainloop_open
(
&
descr_console
);
if
(
ret
<
0
)
{
if
(
ret
<
0
)
{
ERROR
(
"Failed to create console mainloop"
);
ERROR
(
"Failed to create console mainloop"
);
goto
out_mainloop
;
goto
out_mainloop
;
}
}
}
ret
=
lxc_mainloop_add_handler
(
&
descr
,
handler
->
sigfd
,
signal_handler
,
handler
);
ret
=
lxc_mainloop_add_handler
(
&
descr
,
handler
->
sigfd
,
signal_handler
,
handler
);
if
(
ret
<
0
)
{
if
(
ret
<
0
)
{
...
@@ -517,6 +522,9 @@ int lxc_poll(const char *name, struct lxc_handler *handler)
...
@@ -517,6 +522,9 @@ int lxc_poll(const char *name, struct lxc_handler *handler)
#endif
#endif
}
}
if
(
has_console
)
{
struct
lxc_console
*
console
=
&
handler
->
conf
->
console
;
ret
=
lxc_console_mainloop_add
(
&
descr
,
console
);
ret
=
lxc_console_mainloop_add
(
&
descr
,
console
);
if
(
ret
<
0
)
{
if
(
ret
<
0
)
{
ERROR
(
"Failed to add console handlers to mainloop"
);
ERROR
(
"Failed to add console handlers to mainloop"
);
...
@@ -528,6 +536,7 @@ int lxc_poll(const char *name, struct lxc_handler *handler)
...
@@ -528,6 +536,7 @@ int lxc_poll(const char *name, struct lxc_handler *handler)
ERROR
(
"Failed to add console handlers to console mainloop"
);
ERROR
(
"Failed to add console handlers to console mainloop"
);
goto
out_mainloop_console
;
goto
out_mainloop_console
;
}
}
}
ret
=
lxc_cmd_mainloop_add
(
name
,
&
descr
,
handler
);
ret
=
lxc_cmd_mainloop_add
(
name
,
&
descr
,
handler
);
if
(
ret
<
0
)
{
if
(
ret
<
0
)
{
...
@@ -543,11 +552,14 @@ int lxc_poll(const char *name, struct lxc_handler *handler)
...
@@ -543,11 +552,14 @@ int lxc_poll(const char *name, struct lxc_handler *handler)
if
(
ret
<
0
||
!
handler
->
init_died
)
if
(
ret
<
0
||
!
handler
->
init_died
)
goto
out_mainloop_console
;
goto
out_mainloop_console
;
if
(
has_console
)
ret
=
lxc_mainloop
(
&
descr_console
,
0
);
ret
=
lxc_mainloop
(
&
descr_console
,
0
);
out_mainloop_console:
out_mainloop_console:
if
(
has_console
)
{
lxc_mainloop_close
(
&
descr_console
);
lxc_mainloop_close
(
&
descr_console
);
TRACE
(
"Closed console mainloop"
);
TRACE
(
"Closed console mainloop"
);
}
out_mainloop:
out_mainloop:
lxc_mainloop_close
(
&
descr
);
lxc_mainloop_close
(
&
descr
);
...
...
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