mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-08-10 15:02:42 +00:00
console: lxc_terminal_mainloop_add()
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
This commit is contained in:
parent
22b183eafb
commit
093bce5f66
@ -1012,7 +1012,7 @@ static int lxc_attach_pty_mainloop_init(struct lxc_pty *pty,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = lxc_console_mainloop_add(descr, pty);
|
ret = lxc_terminal_mainloop_add(descr, pty);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
ERROR("Failed to add handlers to mainloop");
|
ERROR("Failed to add handlers to mainloop");
|
||||||
lxc_mainloop_close(descr);
|
lxc_mainloop_close(descr);
|
||||||
|
@ -433,7 +433,7 @@ static int lxc_terminal_mainloop_add_peer(struct lxc_pty *console)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int lxc_console_mainloop_add(struct lxc_epoll_descr *descr,
|
int lxc_terminal_mainloop_add(struct lxc_epoll_descr *descr,
|
||||||
struct lxc_pty *console)
|
struct lxc_pty *console)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
@ -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_pty *);
|
extern int lxc_terminal_mainloop_add(struct lxc_epoll_descr *, struct lxc_pty *);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Handle SIGWINCH events on the allocated ptys.
|
* Handle SIGWINCH events on the allocated ptys.
|
||||||
@ -153,7 +153,7 @@ extern int lxc_console_set_stdfds(int fd);
|
|||||||
/*
|
/*
|
||||||
* Handler for events on the stdin fd of the pty. To be registered via the
|
* Handler for events on the stdin fd of the pty. To be registered via the
|
||||||
* corresponding functions declared and defined in mainloop.{c,h} or
|
* corresponding functions declared and defined in mainloop.{c,h} or
|
||||||
* lxc_console_mainloop_add().
|
* lxc_terminal_mainloop_add().
|
||||||
* This function exits the loop cleanly when an EPOLLHUP event is received.
|
* This function exits the loop cleanly when an EPOLLHUP event is received.
|
||||||
*/
|
*/
|
||||||
extern int lxc_console_cb_tty_stdin(int fd, uint32_t events, void *cbdata,
|
extern int lxc_console_cb_tty_stdin(int fd, uint32_t events, void *cbdata,
|
||||||
@ -162,7 +162,7 @@ extern int lxc_console_cb_tty_stdin(int fd, uint32_t events, void *cbdata,
|
|||||||
/*
|
/*
|
||||||
* Handler for events on the master fd of the pty. To be registered via the
|
* Handler for events on the master fd of the pty. To be registered via the
|
||||||
* corresponding functions declared and defined in mainloop.{c,h} or
|
* corresponding functions declared and defined in mainloop.{c,h} or
|
||||||
* lxc_console_mainloop_add().
|
* lxc_terminal_mainloop_add().
|
||||||
* This function exits the loop cleanly when an EPOLLHUP event is received.
|
* This function exits the loop cleanly when an EPOLLHUP event is received.
|
||||||
*/
|
*/
|
||||||
extern int lxc_console_cb_tty_master(int fd, uint32_t events, void *cbdata,
|
extern int lxc_console_cb_tty_master(int fd, uint32_t events, void *cbdata,
|
||||||
@ -209,7 +209,7 @@ extern struct lxc_tty_state *lxc_terminal_signal_init(int srcfd, int dstfd);
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Handler for signal events. To be registered via the corresponding functions
|
* Handler for signal events. To be registered via the corresponding functions
|
||||||
* declared and defined in mainloop.{c,h} or lxc_console_mainloop_add().
|
* declared and defined in mainloop.{c,h} or lxc_terminal_mainloop_add().
|
||||||
*/
|
*/
|
||||||
extern int lxc_terminal_signalfd_cb(int fd, uint32_t events, void *cbdata,
|
extern int lxc_terminal_signalfd_cb(int fd, uint32_t events, void *cbdata,
|
||||||
struct lxc_epoll_descr *descr);
|
struct lxc_epoll_descr *descr);
|
||||||
|
@ -531,13 +531,13 @@ int lxc_poll(const char *name, struct lxc_handler *handler)
|
|||||||
if (has_console) {
|
if (has_console) {
|
||||||
struct lxc_pty *console = &handler->conf->console;
|
struct lxc_pty *console = &handler->conf->console;
|
||||||
|
|
||||||
ret = lxc_console_mainloop_add(&descr, console);
|
ret = lxc_terminal_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");
|
||||||
goto out_mainloop_console;
|
goto out_mainloop_console;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = lxc_console_mainloop_add(&descr_console, console);
|
ret = lxc_terminal_mainloop_add(&descr_console, console);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
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;
|
||||||
|
Loading…
Reference in New Issue
Block a user