and rename exec.errev to exec.stderrev
and make stdinev.fd stdoutev.fd stderrev.fd are valid but different
and register all these event
Signed-off-by: Lai Jiangshan <jiangshanlai@gmail.com>
VmContainer.Tty: allocate tty or not
VmContainer.Stdio: Stdio sequence number
VmContainer.Stderr: Stderr sequence number if stderr is not share with
stdout (currently used when VmContainer.Tty is false)
And new stdio allocation code which respects the VmContainer.Tty.
Signed-off-by: Lai Jiangshan <jiangshanlai@gmail.com>
It uses epoll_pwait() instead of epoll_wait(), and ensures that
the SIGCHLD handling and the events handling are exclusive.
Signed-off-by: Lai Jiangshan <jiangshanlai@gmail.com>
step1: start a container without tty
hyper run ubuntu
step2: get the fdinfo of the stderr
cat /proc/self/fdinfo/2
pos: 0
flags: 04001
mnt_id: 8
it shows that the stderr has the O_NONBLOCK flags,
we should remove it.
Signed-off-by: Lai Jiangshan <jiangshanlai@gmail.com>
For tasks created by clone_VM, they share the memory with parent,
so when parent frees the stack, children may still access to this
stack. so don't free stack when children is still using the stack.
Signed-off-by: Gao feng <omarapazanadi@gmail.com>
./hyper run --rm ubuntu echo xxxx\>\"\\aadasd\"\>\<\>\<\<\<\\\\\\\"\as
POD id is pod-nvpvjBScdB
xxxx>"\aadasd"><><<<\\\"as
echo xxxx\>\"\\aadasd\"\>\<\>\<\<\<\\\\\\\"\as
xxxx>"\aadasd"><><<<\\\"as
Signed-off-by: Gao feng <omarapazanadi@gmail.com>
hyper_container_stage0 shares fd table with init, right now stage0
may close pipe before init read the pipe. this will cause container
fail to start.
Signed-off-by: Gao feng <omarapazanadi@gmail.com>
I happen to find out on centos6.7, glibc-headers does have SYS_setns
defined, but previous release doesn't.
It's better to use configure script to check setns function.
Signed-off-by: WANG Chao <wcwxyz@gmail.com>
the control serial port is opened as unblock fd, set
is as block fd to make sure sending successfully.
Signed-off-by: Gao feng <omarapazanadi@gmail.com>
For example on centos6.x, glibc doesn't contain setns syscall wrapper,
but kernel has setns. We can write a wrapper to simulate the glibc
behavior to fix compile issue.
NOTE: In such case, we will need kernel-headers to get syscall number.
Signed-off-by: WANG Chao <wcwxyz@gmail.com>