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
9785b539
Unverified
Commit
9785b539
authored
Feb 27, 2018
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tree-wide: s/struct lxc_console/struct lxc_pty/g
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
93677636
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
42 additions
and
41 deletions
+42
-41
attach.c
src/lxc/attach.c
+7
-7
conf.c
src/lxc/conf.c
+3
-3
conf.h
src/lxc/conf.h
+3
-3
console.c
src/lxc/console.c
+20
-20
console.h
src/lxc/console.h
+8
-7
start.c
src/lxc/start.c
+1
-1
No files found.
src/lxc/attach.c
View file @
9785b539
...
@@ -974,7 +974,7 @@ on_error:
...
@@ -974,7 +974,7 @@ on_error:
rexit
(
EXIT_FAILURE
);
rexit
(
EXIT_FAILURE
);
}
}
static
int
lxc_attach_pty
(
struct
lxc_conf
*
conf
,
struct
lxc_
console
*
pty
)
static
int
lxc_attach_pty
(
struct
lxc_conf
*
conf
,
struct
lxc_
pty
*
pty
)
{
{
int
ret
;
int
ret
;
...
@@ -1001,7 +1001,7 @@ on_error:
...
@@ -1001,7 +1001,7 @@ on_error:
return
-
1
;
return
-
1
;
}
}
static
int
lxc_attach_pty_mainloop_init
(
struct
lxc_
console
*
pty
,
static
int
lxc_attach_pty_mainloop_init
(
struct
lxc_
pty
*
pty
,
struct
lxc_epoll_descr
*
descr
)
struct
lxc_epoll_descr
*
descr
)
{
{
int
ret
;
int
ret
;
...
@@ -1022,7 +1022,7 @@ static int lxc_attach_pty_mainloop_init(struct lxc_console *pty,
...
@@ -1022,7 +1022,7 @@ static int lxc_attach_pty_mainloop_init(struct lxc_console *pty,
return
0
;
return
0
;
}
}
static
inline
void
lxc_attach_pty_close_master
(
struct
lxc_
console
*
pty
)
static
inline
void
lxc_attach_pty_close_master
(
struct
lxc_
pty
*
pty
)
{
{
if
(
pty
->
master
<
0
)
if
(
pty
->
master
<
0
)
return
;
return
;
...
@@ -1031,7 +1031,7 @@ static inline void lxc_attach_pty_close_master(struct lxc_console *pty)
...
@@ -1031,7 +1031,7 @@ static inline void lxc_attach_pty_close_master(struct lxc_console *pty)
pty
->
master
=
-
EBADF
;
pty
->
master
=
-
EBADF
;
}
}
static
inline
void
lxc_attach_pty_close_slave
(
struct
lxc_
console
*
pty
)
static
inline
void
lxc_attach_pty_close_slave
(
struct
lxc_
pty
*
pty
)
{
{
if
(
pty
->
slave
<
0
)
if
(
pty
->
slave
<
0
)
return
;
return
;
...
@@ -1040,7 +1040,7 @@ static inline void lxc_attach_pty_close_slave(struct lxc_console *pty)
...
@@ -1040,7 +1040,7 @@ static inline void lxc_attach_pty_close_slave(struct lxc_console *pty)
pty
->
slave
=
-
EBADF
;
pty
->
slave
=
-
EBADF
;
}
}
static
inline
void
lxc_attach_pty_close_peer
(
struct
lxc_
console
*
pty
)
static
inline
void
lxc_attach_pty_close_peer
(
struct
lxc_
pty
*
pty
)
{
{
if
(
pty
->
peer
<
0
)
if
(
pty
->
peer
<
0
)
return
;
return
;
...
@@ -1049,7 +1049,7 @@ static inline void lxc_attach_pty_close_peer(struct lxc_console *pty)
...
@@ -1049,7 +1049,7 @@ static inline void lxc_attach_pty_close_peer(struct lxc_console *pty)
pty
->
peer
=
-
EBADF
;
pty
->
peer
=
-
EBADF
;
}
}
static
inline
void
lxc_attach_pty_close_log
(
struct
lxc_
console
*
pty
)
static
inline
void
lxc_attach_pty_close_log
(
struct
lxc_
pty
*
pty
)
{
{
if
(
pty
->
log_fd
<
0
)
if
(
pty
->
log_fd
<
0
)
return
;
return
;
...
@@ -1068,7 +1068,7 @@ int lxc_attach(const char *name, const char *lxcpath,
...
@@ -1068,7 +1068,7 @@ int lxc_attach(const char *name, const char *lxcpath,
signed
long
personality
;
signed
long
personality
;
pid_t
attached_pid
,
init_pid
,
pid
;
pid_t
attached_pid
,
init_pid
,
pid
;
struct
lxc_proc_context_info
*
init_ctx
;
struct
lxc_proc_context_info
*
init_ctx
;
struct
lxc_
console
pty
;
struct
lxc_
pty
pty
;
struct
lxc_conf
*
conf
;
struct
lxc_conf
*
conf
;
struct
attach_clone_payload
payload
=
{
0
};
struct
attach_clone_payload
payload
=
{
0
};
...
...
src/lxc/conf.c
View file @
9785b539
...
@@ -1578,7 +1578,7 @@ static int setup_personality(int persona)
...
@@ -1578,7 +1578,7 @@ static int setup_personality(int persona)
}
}
static
int
lxc_setup_dev_console
(
const
struct
lxc_rootfs
*
rootfs
,
static
int
lxc_setup_dev_console
(
const
struct
lxc_rootfs
*
rootfs
,
const
struct
lxc_
console
*
console
)
const
struct
lxc_
pty
*
console
)
{
{
char
path
[
MAXPATHLEN
];
char
path
[
MAXPATHLEN
];
int
ret
,
fd
;
int
ret
,
fd
;
...
@@ -1634,7 +1634,7 @@ static int lxc_setup_dev_console(const struct lxc_rootfs *rootfs,
...
@@ -1634,7 +1634,7 @@ static int lxc_setup_dev_console(const struct lxc_rootfs *rootfs,
}
}
static
int
lxc_setup_ttydir_console
(
const
struct
lxc_rootfs
*
rootfs
,
static
int
lxc_setup_ttydir_console
(
const
struct
lxc_rootfs
*
rootfs
,
const
struct
lxc_
console
*
console
,
const
struct
lxc_
pty
*
console
,
char
*
ttydir
)
char
*
ttydir
)
{
{
int
ret
,
fd
;
int
ret
,
fd
;
...
@@ -1720,7 +1720,7 @@ static int lxc_setup_ttydir_console(const struct lxc_rootfs *rootfs,
...
@@ -1720,7 +1720,7 @@ static int lxc_setup_ttydir_console(const struct lxc_rootfs *rootfs,
}
}
static
int
lxc_setup_console
(
const
struct
lxc_rootfs
*
rootfs
,
static
int
lxc_setup_console
(
const
struct
lxc_rootfs
*
rootfs
,
const
struct
lxc_
console
*
console
,
char
*
ttydir
)
const
struct
lxc_
pty
*
console
,
char
*
ttydir
)
{
{
if
(
!
ttydir
)
if
(
!
ttydir
)
...
...
src/lxc/conf.h
View file @
9785b539
...
@@ -164,7 +164,7 @@ struct lxc_tty_state;
...
@@ -164,7 +164,7 @@ struct lxc_tty_state;
* @peer : the file descriptor put/get console traffic
* @peer : the file descriptor put/get console traffic
* @name : the file name of the slave pty
* @name : the file name of the slave pty
*/
*/
struct
lxc_
console
{
struct
lxc_
pty
{
int
slave
;
int
slave
;
int
master
;
int
master
;
int
peer
;
int
peer
;
...
@@ -189,7 +189,7 @@ struct lxc_console {
...
@@ -189,7 +189,7 @@ struct lxc_console {
unsigned
int
log_rotate
;
unsigned
int
log_rotate
;
};
};
struct
/* lxc_
console
_ringbuf */
{
struct
/* lxc_
pty
_ringbuf */
{
/* size of the ringbuffer */
/* size of the ringbuffer */
uint64_t
buffer_size
;
uint64_t
buffer_size
;
...
@@ -314,7 +314,7 @@ struct lxc_conf {
...
@@ -314,7 +314,7 @@ struct lxc_conf {
struct
lxc_tty_info
tty_info
;
struct
lxc_tty_info
tty_info
;
/* Comma-separated list of lxc.tty.max pty names. */
/* Comma-separated list of lxc.tty.max pty names. */
char
*
pty_names
;
char
*
pty_names
;
struct
lxc_
console
console
;
struct
lxc_
pty
console
;
struct
lxc_rootfs
rootfs
;
struct
lxc_rootfs
rootfs
;
char
*
ttydir
;
char
*
ttydir
;
int
close_all_fds
;
int
close_all_fds
;
...
...
src/lxc/console.c
View file @
9785b539
...
@@ -204,7 +204,7 @@ void lxc_console_signal_fini(struct lxc_tty_state *ts)
...
@@ -204,7 +204,7 @@ void lxc_console_signal_fini(struct lxc_tty_state *ts)
free
(
ts
);
free
(
ts
);
}
}
static
int
lxc_console_truncate_log_file
(
struct
lxc_
console
*
console
)
static
int
lxc_console_truncate_log_file
(
struct
lxc_
pty
*
console
)
{
{
/* be very certain things are kosher */
/* be very certain things are kosher */
if
(
!
console
->
log_path
||
console
->
log_fd
<
0
)
if
(
!
console
->
log_path
||
console
->
log_fd
<
0
)
...
@@ -213,7 +213,7 @@ static int lxc_console_truncate_log_file(struct lxc_console *console)
...
@@ -213,7 +213,7 @@ static int lxc_console_truncate_log_file(struct lxc_console *console)
return
lxc_unpriv
(
ftruncate
(
console
->
log_fd
,
0
));
return
lxc_unpriv
(
ftruncate
(
console
->
log_fd
,
0
));
}
}
static
int
lxc_console_rotate_log_file
(
struct
lxc_
console
*
console
)
static
int
lxc_console_rotate_log_file
(
struct
lxc_
pty
*
console
)
{
{
int
ret
;
int
ret
;
size_t
len
;
size_t
len
;
...
@@ -242,7 +242,7 @@ static int lxc_console_rotate_log_file(struct lxc_console *console)
...
@@ -242,7 +242,7 @@ static int lxc_console_rotate_log_file(struct lxc_console *console)
return
lxc_console_create_log_file
(
console
);
return
lxc_console_create_log_file
(
console
);
}
}
static
int
lxc_console_write_log_file
(
struct
lxc_
console
*
console
,
char
*
buf
,
static
int
lxc_console_write_log_file
(
struct
lxc_
pty
*
console
,
char
*
buf
,
int
bytes_read
)
int
bytes_read
)
{
{
int
ret
;
int
ret
;
...
@@ -351,7 +351,7 @@ static int lxc_console_write_log_file(struct lxc_console *console, char *buf,
...
@@ -351,7 +351,7 @@ static int lxc_console_write_log_file(struct lxc_console *console, char *buf,
int
lxc_console_cb_con
(
int
fd
,
uint32_t
events
,
void
*
data
,
int
lxc_console_cb_con
(
int
fd
,
uint32_t
events
,
void
*
data
,
struct
lxc_epoll_descr
*
descr
)
struct
lxc_epoll_descr
*
descr
)
{
{
struct
lxc_
console
*
console
=
(
struct
lxc_console
*
)
data
;
struct
lxc_
pty
*
console
=
data
;
char
buf
[
LXC_CONSOLE_BUFFER_SIZE
];
char
buf
[
LXC_CONSOLE_BUFFER_SIZE
];
int
r
,
w
,
w_log
,
w_rbuf
;
int
r
,
w
,
w_log
,
w_rbuf
;
...
@@ -407,7 +407,7 @@ int lxc_console_cb_con(int fd, uint32_t events, void *data,
...
@@ -407,7 +407,7 @@ int lxc_console_cb_con(int fd, uint32_t events, void *data,
return
0
;
return
0
;
}
}
static
int
lxc_console_mainloop_add_peer
(
struct
lxc_
console
*
console
)
static
int
lxc_console_mainloop_add_peer
(
struct
lxc_
pty
*
console
)
{
{
int
ret
;
int
ret
;
...
@@ -434,7 +434,7 @@ static int lxc_console_mainloop_add_peer(struct lxc_console *console)
...
@@ -434,7 +434,7 @@ static int lxc_console_mainloop_add_peer(struct lxc_console *console)
}
}
int
lxc_console_mainloop_add
(
struct
lxc_epoll_descr
*
descr
,
int
lxc_console_mainloop_add
(
struct
lxc_epoll_descr
*
descr
,
struct
lxc_
console
*
console
)
struct
lxc_
pty
*
console
)
{
{
int
ret
;
int
ret
;
...
@@ -509,7 +509,7 @@ int lxc_setup_tios(int fd, struct termios *oldtios)
...
@@ -509,7 +509,7 @@ int lxc_setup_tios(int fd, struct termios *oldtios)
return
0
;
return
0
;
}
}
static
void
lxc_console_peer_proxy_free
(
struct
lxc_
console
*
console
)
static
void
lxc_console_peer_proxy_free
(
struct
lxc_
pty
*
console
)
{
{
if
(
console
->
tty_state
)
{
if
(
console
->
tty_state
)
{
lxc_console_signal_fini
(
console
->
tty_state
);
lxc_console_signal_fini
(
console
->
tty_state
);
...
@@ -524,7 +524,7 @@ static void lxc_console_peer_proxy_free(struct lxc_console *console)
...
@@ -524,7 +524,7 @@ static void lxc_console_peer_proxy_free(struct lxc_console *console)
console
->
peer
=
-
1
;
console
->
peer
=
-
1
;
}
}
static
int
lxc_console_peer_proxy_alloc
(
struct
lxc_
console
*
console
,
int
sockfd
)
static
int
lxc_console_peer_proxy_alloc
(
struct
lxc_
pty
*
console
,
int
sockfd
)
{
{
struct
termios
oldtermio
;
struct
termios
oldtermio
;
struct
lxc_tty_state
*
ts
;
struct
lxc_tty_state
*
ts
;
...
@@ -579,7 +579,7 @@ int lxc_console_allocate(struct lxc_conf *conf, int sockfd, int *ttyreq)
...
@@ -579,7 +579,7 @@ int lxc_console_allocate(struct lxc_conf *conf, int sockfd, int *ttyreq)
{
{
int
masterfd
=
-
1
,
ttynum
;
int
masterfd
=
-
1
,
ttynum
;
struct
lxc_tty_info
*
tty_info
=
&
conf
->
tty_info
;
struct
lxc_tty_info
*
tty_info
=
&
conf
->
tty_info
;
struct
lxc_
console
*
console
=
&
conf
->
console
;
struct
lxc_
pty
*
console
=
&
conf
->
console
;
if
(
*
ttyreq
==
0
)
{
if
(
*
ttyreq
==
0
)
{
if
(
lxc_console_peer_proxy_alloc
(
console
,
sockfd
)
<
0
)
if
(
lxc_console_peer_proxy_alloc
(
console
,
sockfd
)
<
0
)
...
@@ -621,7 +621,7 @@ void lxc_console_free(struct lxc_conf *conf, int fd)
...
@@ -621,7 +621,7 @@ void lxc_console_free(struct lxc_conf *conf, int fd)
{
{
int
i
;
int
i
;
struct
lxc_tty_info
*
tty_info
=
&
conf
->
tty_info
;
struct
lxc_tty_info
*
tty_info
=
&
conf
->
tty_info
;
struct
lxc_
console
*
console
=
&
conf
->
console
;
struct
lxc_
pty
*
console
=
&
conf
->
console
;
for
(
i
=
0
;
i
<
tty_info
->
nbtty
;
i
++
)
{
for
(
i
=
0
;
i
<
tty_info
->
nbtty
;
i
++
)
{
if
(
tty_info
->
pty_info
[
i
].
busy
==
fd
)
if
(
tty_info
->
pty_info
[
i
].
busy
==
fd
)
...
@@ -634,7 +634,7 @@ void lxc_console_free(struct lxc_conf *conf, int fd)
...
@@ -634,7 +634,7 @@ void lxc_console_free(struct lxc_conf *conf, int fd)
}
}
}
}
static
int
lxc_console_peer_default
(
struct
lxc_
console
*
console
)
static
int
lxc_console_peer_default
(
struct
lxc_
pty
*
console
)
{
{
struct
lxc_tty_state
*
ts
;
struct
lxc_tty_state
*
ts
;
const
char
*
path
=
console
->
path
;
const
char
*
path
=
console
->
path
;
...
@@ -703,7 +703,7 @@ out:
...
@@ -703,7 +703,7 @@ out:
return
ret
;
return
ret
;
}
}
int
lxc_console_write_ringbuffer
(
struct
lxc_
console
*
console
)
int
lxc_console_write_ringbuffer
(
struct
lxc_
pty
*
console
)
{
{
char
*
r_addr
;
char
*
r_addr
;
ssize_t
ret
;
ssize_t
ret
;
...
@@ -738,7 +738,7 @@ int lxc_console_write_ringbuffer(struct lxc_console *console)
...
@@ -738,7 +738,7 @@ int lxc_console_write_ringbuffer(struct lxc_console *console)
return
0
;
return
0
;
}
}
void
lxc_console_delete
(
struct
lxc_
console
*
console
)
void
lxc_console_delete
(
struct
lxc_
pty
*
console
)
{
{
int
ret
;
int
ret
;
...
@@ -776,7 +776,7 @@ void lxc_console_delete(struct lxc_console *console)
...
@@ -776,7 +776,7 @@ void lxc_console_delete(struct lxc_console *console)
* register a handler for the console's masterfd when we create the mainloop
* register a handler for the console's masterfd when we create the mainloop
* the console handler needs to see an allocated ringbuffer.
* the console handler needs to see an allocated ringbuffer.
*/
*/
static
int
lxc_console_create_ringbuf
(
struct
lxc_
console
*
console
)
static
int
lxc_console_create_ringbuf
(
struct
lxc_
pty
*
console
)
{
{
int
ret
;
int
ret
;
struct
lxc_ringbuf
*
buf
=
&
console
->
ringbuf
;
struct
lxc_ringbuf
*
buf
=
&
console
->
ringbuf
;
...
@@ -822,7 +822,7 @@ static int lxc_console_create_ringbuf(struct lxc_console *console)
...
@@ -822,7 +822,7 @@ static int lxc_console_create_ringbuf(struct lxc_console *console)
* This is the console log file. Please note that the console log file is
* This is the console log file. Please note that the console log file is
* (implementation wise not content wise) independent of the console ringbuffer.
* (implementation wise not content wise) independent of the console ringbuffer.
*/
*/
int
lxc_console_create_log_file
(
struct
lxc_
console
*
console
)
int
lxc_console_create_log_file
(
struct
lxc_
pty
*
console
)
{
{
if
(
!
console
->
log_path
)
if
(
!
console
->
log_path
)
return
0
;
return
0
;
...
@@ -837,7 +837,7 @@ int lxc_console_create_log_file(struct lxc_console *console)
...
@@ -837,7 +837,7 @@ int lxc_console_create_log_file(struct lxc_console *console)
return
0
;
return
0
;
}
}
int
lxc_pty_create
(
struct
lxc_
console
*
console
)
int
lxc_pty_create
(
struct
lxc_
pty
*
console
)
{
{
int
ret
,
saved_errno
;
int
ret
,
saved_errno
;
...
@@ -877,7 +877,7 @@ err:
...
@@ -877,7 +877,7 @@ err:
int
lxc_console_create
(
struct
lxc_conf
*
conf
)
int
lxc_console_create
(
struct
lxc_conf
*
conf
)
{
{
int
ret
;
int
ret
;
struct
lxc_
console
*
console
=
&
conf
->
console
;
struct
lxc_
pty
*
console
=
&
conf
->
console
;
if
(
console
->
path
&&
!
strcmp
(
console
->
path
,
"none"
))
{
if
(
console
->
path
&&
!
strcmp
(
console
->
path
,
"none"
))
{
INFO
(
"No console was requested"
);
INFO
(
"No console was requested"
);
...
@@ -1140,7 +1140,7 @@ void lxc_pty_info_init(struct lxc_pty_info *pty)
...
@@ -1140,7 +1140,7 @@ void lxc_pty_info_init(struct lxc_pty_info *pty)
pty
->
busy
=
-
1
;
pty
->
busy
=
-
1
;
}
}
void
lxc_pty_init
(
struct
lxc_
console
*
pty
)
void
lxc_pty_init
(
struct
lxc_
pty
*
pty
)
{
{
memset
(
pty
,
0
,
sizeof
(
*
pty
));
memset
(
pty
,
0
,
sizeof
(
*
pty
));
pty
->
slave
=
-
EBADF
;
pty
->
slave
=
-
EBADF
;
...
@@ -1150,7 +1150,7 @@ void lxc_pty_init(struct lxc_console *pty)
...
@@ -1150,7 +1150,7 @@ void lxc_pty_init(struct lxc_console *pty)
lxc_pty_info_init
(
&
pty
->
peerpty
);
lxc_pty_info_init
(
&
pty
->
peerpty
);
}
}
void
lxc_pty_conf_free
(
struct
lxc_
console
*
console
)
void
lxc_pty_conf_free
(
struct
lxc_
pty
*
console
)
{
{
free
(
console
->
log_path
);
free
(
console
->
log_path
);
free
(
console
->
path
);
free
(
console
->
path
);
...
@@ -1158,7 +1158,7 @@ void lxc_pty_conf_free(struct lxc_console *console)
...
@@ -1158,7 +1158,7 @@ void lxc_pty_conf_free(struct lxc_console *console)
lxc_ringbuf_release
(
&
console
->
ringbuf
);
lxc_ringbuf_release
(
&
console
->
ringbuf
);
}
}
int
lxc_pty_map_ids
(
struct
lxc_conf
*
c
,
struct
lxc_
console
*
pty
)
int
lxc_pty_map_ids
(
struct
lxc_conf
*
c
,
struct
lxc_
pty
*
pty
)
{
{
int
ret
;
int
ret
;
...
...
src/lxc/console.h
View file @
9785b539
...
@@ -82,7 +82,7 @@ extern int lxc_console_allocate(struct lxc_conf *conf, int sockfd, int *ttynum)
...
@@ -82,7 +82,7 @@ extern int lxc_console_allocate(struct lxc_conf *conf, int sockfd, int *ttynum)
* automatically chowned to the uid/gid of the unprivileged user. For this
* automatically chowned to the uid/gid of the unprivileged user. For this
* ttys_shift_ids() can be called.)
* ttys_shift_ids() can be called.)
*/
*/
extern
int
lxc_pty_create
(
struct
lxc_
console
*
console
);
extern
int
lxc_pty_create
(
struct
lxc_
pty
*
console
);
/**
/**
* lxc_console_create: Create a new pty.
* lxc_console_create: Create a new pty.
...
@@ -98,7 +98,7 @@ extern int lxc_console_create(struct lxc_conf *);
...
@@ -98,7 +98,7 @@ extern int lxc_console_create(struct lxc_conf *);
* /dev/tty)
* /dev/tty)
* Registered handlers in a mainloop are not automatically deleted.
* Registered handlers in a mainloop are not automatically deleted.
*/
*/
extern
void
lxc_console_delete
(
struct
lxc_
console
*
);
extern
void
lxc_console_delete
(
struct
lxc_
pty
*
);
/*
/*
* lxc_console_free: mark the console or a tty as unallocated, free any
* lxc_console_free: mark the console or a tty as unallocated, free any
...
@@ -114,7 +114,7 @@ extern void lxc_console_free(struct lxc_conf *conf, int fd);
...
@@ -114,7 +114,7 @@ extern void lxc_console_free(struct lxc_conf *conf, int fd);
/*
/*
* Register pty event handlers in an open mainloop
* Register pty event handlers in an open mainloop
*/
*/
extern
int
lxc_console_mainloop_add
(
struct
lxc_epoll_descr
*
,
struct
lxc_
console
*
);
extern
int
lxc_console_mainloop_add
(
struct
lxc_epoll_descr
*
,
struct
lxc_
pty
*
);
/*
/*
* Handle SIGWINCH events on the allocated ptys.
* Handle SIGWINCH events on the allocated ptys.
...
@@ -227,15 +227,16 @@ extern int lxc_console_cb_signal_fd(int fd, uint32_t events, void *cbdata,
...
@@ -227,15 +227,16 @@ extern int lxc_console_cb_signal_fd(int fd, uint32_t events, void *cbdata,
*/
*/
extern
void
lxc_console_signal_fini
(
struct
lxc_tty_state
*
ts
);
extern
void
lxc_console_signal_fini
(
struct
lxc_tty_state
*
ts
);
extern
int
lxc_console_create_log_file
(
struct
lxc_console
*
console
);
extern
int
lxc_console_write_ringbuffer
(
struct
lxc_pty
*
console
);
extern
int
lxc_console_create_log_file
(
struct
lxc_pty
*
console
);
extern
int
lxc_console_cb_con
(
int
fd
,
uint32_t
events
,
void
*
data
,
extern
int
lxc_console_cb_con
(
int
fd
,
uint32_t
events
,
void
*
data
,
struct
lxc_epoll_descr
*
descr
);
struct
lxc_epoll_descr
*
descr
);
extern
int
lxc_make_controlling_pty
(
int
fd
);
extern
int
lxc_make_controlling_pty
(
int
fd
);
extern
int
lxc_login_pty
(
int
fd
);
extern
int
lxc_login_pty
(
int
fd
);
extern
void
lxc_pty_conf_free
(
struct
lxc_
console
*
console
);
extern
void
lxc_pty_conf_free
(
struct
lxc_
pty
*
console
);
extern
void
lxc_pty_info_init
(
struct
lxc_pty_info
*
pty
);
extern
void
lxc_pty_info_init
(
struct
lxc_pty_info
*
pty
);
extern
void
lxc_pty_init
(
struct
lxc_
console
*
pty
);
extern
void
lxc_pty_init
(
struct
lxc_
pty
*
pty
);
extern
int
lxc_pty_map_ids
(
struct
lxc_conf
*
c
,
struct
lxc_
console
*
pty
);
extern
int
lxc_pty_map_ids
(
struct
lxc_conf
*
c
,
struct
lxc_
pty
*
pty
);
#endif
#endif
src/lxc/start.c
View file @
9785b539
...
@@ -529,7 +529,7 @@ int lxc_poll(const char *name, struct lxc_handler *handler)
...
@@ -529,7 +529,7 @@ int lxc_poll(const char *name, struct lxc_handler *handler)
}
}
if
(
has_console
)
{
if
(
has_console
)
{
struct
lxc_
console
*
console
=
&
handler
->
conf
->
console
;
struct
lxc_
pty
*
console
=
&
handler
->
conf
->
console
;
ret
=
lxc_console_mainloop_add
(
&
descr
,
console
);
ret
=
lxc_console_mainloop_add
(
&
descr
,
console
);
if
(
ret
<
0
)
{
if
(
ret
<
0
)
{
...
...
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