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
8ccbbf94
Unverified
Commit
8ccbbf94
authored
Feb 27, 2018
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
commands: lxc_cmd_terimal_winch()
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
dad4a039
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
11 deletions
+11
-11
commands.c
src/lxc/commands.c
+7
-7
commands.h
src/lxc/commands.h
+2
-2
console.c
src/lxc/console.c
+2
-2
No files found.
src/lxc/commands.c
View file @
8ccbbf94
...
...
@@ -82,7 +82,7 @@ static const char *lxc_cmd_str(lxc_cmd_t cmd)
{
static
const
char
*
const
cmdname
[
LXC_CMD_MAX
]
=
{
[
LXC_CMD_CONSOLE
]
=
"console"
,
[
LXC_CMD_
CONSOLE_WINCH
]
=
"console
_winch"
,
[
LXC_CMD_
TERMINAL_WINCH
]
=
"terminal
_winch"
,
[
LXC_CMD_STOP
]
=
"stop"
,
[
LXC_CMD_GET_STATE
]
=
"get_state"
,
[
LXC_CMD_GET_INIT_PID
]
=
"get_init_pid"
,
...
...
@@ -659,18 +659,18 @@ static int lxc_cmd_stop_callback(int fd, struct lxc_cmd_req *req,
}
/*
* lxc_cmd_
console
_winch: To process as if a SIGWINCH were received
* lxc_cmd_
terminal
_winch: To process as if a SIGWINCH were received
*
* @name : name of container to connect to
* @lxcpath : the lxcpath in which the container is running
*
* Returns 0 on success, < 0 on failure
*/
int
lxc_cmd_
console
_winch
(
const
char
*
name
,
const
char
*
lxcpath
)
int
lxc_cmd_
terminal
_winch
(
const
char
*
name
,
const
char
*
lxcpath
)
{
int
ret
,
stopped
;
struct
lxc_cmd_rr
cmd
=
{
.
req
=
{
.
cmd
=
LXC_CMD_
CONSOLE
_WINCH
},
.
req
=
{
.
cmd
=
LXC_CMD_
TERMINAL
_WINCH
},
};
ret
=
lxc_cmd
(
name
,
&
cmd
,
&
stopped
,
lxcpath
,
NULL
);
...
...
@@ -680,8 +680,8 @@ int lxc_cmd_console_winch(const char *name, const char *lxcpath)
return
0
;
}
static
int
lxc_cmd_
console
_winch_callback
(
int
fd
,
struct
lxc_cmd_req
*
req
,
struct
lxc_handler
*
handler
)
static
int
lxc_cmd_
terminal
_winch_callback
(
int
fd
,
struct
lxc_cmd_req
*
req
,
struct
lxc_handler
*
handler
)
{
struct
lxc_cmd_rsp
rsp
=
{
.
data
=
0
};
...
...
@@ -1052,7 +1052,7 @@ static int lxc_cmd_process(int fd, struct lxc_cmd_req *req,
callback
cb
[
LXC_CMD_MAX
]
=
{
[
LXC_CMD_CONSOLE
]
=
lxc_cmd_console_callback
,
[
LXC_CMD_
CONSOLE_WINCH
]
=
lxc_cmd_console
_winch_callback
,
[
LXC_CMD_
TERMINAL_WINCH
]
=
lxc_cmd_terminal
_winch_callback
,
[
LXC_CMD_STOP
]
=
lxc_cmd_stop_callback
,
[
LXC_CMD_GET_STATE
]
=
lxc_cmd_get_state_callback
,
[
LXC_CMD_GET_INIT_PID
]
=
lxc_cmd_get_init_pid_callback
,
...
...
src/lxc/commands.h
View file @
8ccbbf94
...
...
@@ -39,7 +39,7 @@
typedef
enum
{
LXC_CMD_CONSOLE
,
LXC_CMD_
CONSOLE
_WINCH
,
LXC_CMD_
TERMINAL
_WINCH
,
LXC_CMD_STOP
,
LXC_CMD_GET_STATE
,
LXC_CMD_GET_INIT_PID
,
...
...
@@ -84,7 +84,7 @@ struct lxc_cmd_console_log {
};
extern
int
lxc_cmd_
console
_winch
(
const
char
*
name
,
const
char
*
lxcpath
);
extern
int
lxc_cmd_
terminal
_winch
(
const
char
*
name
,
const
char
*
lxcpath
);
extern
int
lxc_cmd_console
(
const
char
*
name
,
int
*
ttynum
,
int
*
fd
,
const
char
*
lxcpath
);
/*
...
...
src/lxc/console.c
View file @
8ccbbf94
...
...
@@ -93,7 +93,7 @@ static void lxc_terminal_winch(struct lxc_tty_state *ts)
lxc_terminal_winsz
(
ts
->
stdinfd
,
ts
->
masterfd
);
if
(
ts
->
winch_proxy
)
lxc_cmd_
console
_winch
(
ts
->
winch_proxy
,
ts
->
winch_proxy_lxcpath
);
lxc_cmd_
terminal
_winch
(
ts
->
winch_proxy
,
ts
->
winch_proxy_lxcpath
);
}
void
lxc_terminal_sigwinch
(
int
sig
)
...
...
@@ -1023,7 +1023,7 @@ int lxc_console(struct lxc_container *c, int ttynum,
istty
=
isatty
(
stdinfd
);
if
(
istty
)
{
lxc_terminal_winsz
(
stdinfd
,
masterfd
);
lxc_cmd_
console
_winch
(
ts
->
winch_proxy
,
ts
->
winch_proxy_lxcpath
);
lxc_cmd_
terminal
_winch
(
ts
->
winch_proxy
,
ts
->
winch_proxy_lxcpath
);
}
else
{
INFO
(
"File descriptor %d does not refer to a tty device"
,
stdinfd
);
}
...
...
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