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
7bc5a80b
Commit
7bc5a80b
authored
Jan 18, 2018
by
LiFeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Create console when the rootfs is NULL
Signed-off-by:
LiFeng
<
lifeng68@huawei.com
>
parent
dc4f8fb1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
17 deletions
+1
-17
console.c
src/lxc/console.c
+0
-6
start.c
src/lxc/start.c
+1
-11
No files found.
src/lxc/console.c
View file @
7bc5a80b
...
@@ -747,12 +747,6 @@ int lxc_console_create(struct lxc_conf *conf)
...
@@ -747,12 +747,6 @@ int lxc_console_create(struct lxc_conf *conf)
int
ret
;
int
ret
;
struct
lxc_console
*
console
=
&
conf
->
console
;
struct
lxc_console
*
console
=
&
conf
->
console
;
if
(
!
conf
->
rootfs
.
path
)
{
INFO
(
"Container does not have a rootfs. The console will be "
"shared with the host"
);
return
0
;
}
if
(
console
->
path
&&
!
strcmp
(
console
->
path
,
"none"
))
{
if
(
console
->
path
&&
!
strcmp
(
console
->
path
,
"none"
))
{
INFO
(
"No console was requested"
);
INFO
(
"No console was requested"
);
return
0
;
return
0
;
...
...
src/lxc/start.c
View file @
7bc5a80b
...
@@ -472,7 +472,7 @@ int lxc_set_state(const char *name, struct lxc_handler *handler,
...
@@ -472,7 +472,7 @@ 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
;
bool
has_console
=
(
handler
->
conf
->
rootfs
.
path
!=
NULL
)
;
struct
lxc_console
*
console
=
&
handler
->
conf
->
console
;
struct
lxc_epoll_descr
descr
,
descr_console
;
struct
lxc_epoll_descr
descr
,
descr_console
;
ret
=
lxc_mainloop_open
(
&
descr
);
ret
=
lxc_mainloop_open
(
&
descr
);
...
@@ -481,13 +481,11 @@ int lxc_poll(const char *name, struct lxc_handler *handler)
...
@@ -481,13 +481,11 @@ int lxc_poll(const char *name, struct lxc_handler *handler)
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
)
{
...
@@ -495,9 +493,6 @@ int lxc_poll(const char *name, struct lxc_handler *handler)
...
@@ -495,9 +493,6 @@ int lxc_poll(const char *name, struct lxc_handler *handler)
goto
out_mainloop_console
;
goto
out_mainloop_console
;
}
}
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"
);
...
@@ -509,7 +504,6 @@ int lxc_poll(const char *name, struct lxc_handler *handler)
...
@@ -509,7 +504,6 @@ 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
)
{
...
@@ -525,19 +519,15 @@ int lxc_poll(const char *name, struct lxc_handler *handler)
...
@@ -525,19 +519,15 @@ 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
;
goto
out_mainloop
;
if
(
has_console
)
ret
=
lxc_mainloop
(
&
descr_console
,
0
);
ret
=
lxc_mainloop
(
&
descr_console
,
0
);
out_mainloop:
out_mainloop:
lxc_mainloop_close
(
&
descr
);
lxc_mainloop_close
(
&
descr
);
TRACE
(
"Closed mainloop"
);
TRACE
(
"Closed mainloop"
);
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_sigfd:
out_sigfd:
close
(
handler
->
sigfd
);
close
(
handler
->
sigfd
);
...
...
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