Commit Graph

169 Commits

Author SHA1 Message Date
feisky 613a5a19db Merge pull request #51 from laijs/pipes-stdio
use pipes for stdio when non tty
2016-03-10 17:13:32 +08:00
Lai Jiangshan 21d63485b1 use pipes for stdio when non tty
Signed-off-by: Lai Jiangshan <jiangshanlai@gmail.com>
2016-03-10 00:14:03 +08:00
Lai Jiangshan eaae1ae3fb split exec.e into exec.stdinev and exec.stdoutev
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>
2016-03-09 23:53:59 +08:00
Lai Jiangshan 333263b344 pass @exec to pts_hup()
Signed-off-by: Lai Jiangshan <jiangshanlai@gmail.com>
2016-03-09 16:07:53 +08:00
Lai Jiangshan 50db29c634 add stdinfd/stdoutfd and rename errfd to stderrfd
Signed-off-by: Lai Jiangshan <jiangshanlai@gmail.com>
2016-03-09 16:01:17 +08:00
Lai Jiangshan fe5c6c29e1 use e->errfd directly to create stderr
Signed-off-by: Lai Jiangshan <jiangshanlai@gmail.com>
2016-03-09 15:46:04 +08:00
Lai Jiangshan 34d842901d always setup exec->errfd
Signed-off-by: Lai Jiangshan <jiangshanlai@gmail.com>
2016-03-09 15:45:48 +08:00
Lai Jiangshan a94833c482 open /dev/null for ptyfd in hyper_setup_exec_tty() when seq=0
Signed-off-by: Lai Jiangshan <jiangshanlai@gmail.com>
2016-03-09 15:45:37 +08:00
Gao feng 0676ed3227 Merge pull request #50 from laijs/enable-non-tty-stdio
Enable non tty stdio
2016-03-09 10:42:48 +08:00
Lai Jiangshan e12e480f79 change VmContainer's stdio's protocal
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>
2016-03-08 21:03:34 +08:00
Lai Jiangshan 3fa27e7464 handle eof for the stdio handling
Signed-off-by: Lai Jiangshan <jiangshanlai@gmail.com>
2016-03-08 21:02:42 +08:00
Lai Jiangshan 013cbb7e1a Merge pull request #49 from laijs/pause
pause() in the pod_init loop
2016-03-07 23:22:52 +08:00
Lai Jiangshan 97aee2acb0 pause() in the pod_init loop
Signed-off-by: Lai Jiangshan <jiangshanlai@gmail.com>
2016-03-07 23:00:17 +08:00
Gao feng 43c2336d7f Merge pull request #48 from laijs/sigchld
Simplify SIGCHLD handling and make it exclusive with event handling
2016-03-07 22:50:44 +08:00
Lai Jiangshan 220677d76d simplify SIGCHLD handling of hyper_init
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>
2016-03-07 21:42:25 +08:00
Lai Jiangshan 0f396470ff simplify SIGCHLD handling of pod_init
Signed-off-by: Lai Jiangshan <jiangshanlai@gmail.com>
2016-03-07 21:38:52 +08:00
Xu Wang 94266c5111 Merge pull request #47 from laijs/no-nonblock-stderr
remove O_NONBLOCK from stderr
2016-03-06 07:29:56 +08:00
Lai Jiangshan 0b3370f6fa remove O_NONBLOCK from stderr
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>
2016-03-05 21:49:38 +08:00
Lai Jiangshan c5abeccb65 Merge pull request #46 from laijs/missing-exit
add missing exit(0) to hyper_cmd_online_cpu_mem()
2016-02-29 23:00:12 +08:00
Lai Jiangshan aa7772b36c add missing exit(0) to hyper_cmd_online_cpu_mem()
Signed-off-by: Lai Jiangshan <jiangshanlai@gmail.com>
2016-02-29 22:59:05 +08:00
Lai Jiangshan f47d84cf24 Merge pull request #45 from gao-feng/fix-free
free stack after cloned children finished
2016-02-29 18:58:51 +08:00
Gao feng d97485cfc0 free stack after cloned children finished
avoid children using the freed memory.

Signed-off-by: Gao feng <omarapazanadi@gmail.com>
2016-02-26 14:53:40 +08:00
Lai Jiangshan 4fc4ac0c46 Merge pull request #44 from laijs/online-cpu-mem
add ONLINECPUMEM command
2016-02-22 10:04:34 +08:00
Lai Jiangshan bd41fcfbe6 add ONLINECPUMEM command
Signed-off-by: Lai Jiangshan <jiangshanlai@gmail.com>
2016-02-19 13:31:07 +08:00
Gao feng bd9623c892 Merge pull request #43 from gnawux/release-0.5
release hyper/runv 0.5
v0.5.0
2016-02-05 15:46:51 +08:00
Xu Wang 00e65b239c release hyper/runv 0.5
Signed-off-by: Xu Wang <gnawux@gmail.com>
2016-02-05 15:42:36 +08:00
Lai Jiangshan b654a0fbd3 Merge pull request #42 from gao-feng/free
fix possible access memory after free
2016-02-01 10:56:40 +08:00
Gao feng 2f757d249d Merge pull request #41 from gnawux/resize_cbfs
new kernel is bigger, increase the cbfs rom size
2016-01-31 21:22:45 +08:00
Gao feng db33f31dc1 fix possible access memory after free
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>
2016-01-31 19:24:07 +08:00
Wang Xu 661dcdda07 new kernel is bigger, increase the cbfs rom size
Signed-off-by: Wang Xu <gnawux@gmail.com>
2016-01-30 23:42:06 +08:00
Gao feng 22a65f7666 Merge pull request #40 from laijs/hot-add-cpu-mem
enable hot adding cpu/mem
2016-01-28 15:51:17 +08:00
Lai Jiangshan 1ce35da941 enable hot adding cpu/mem
Signed-off-by: Lai Jiangshan <jiangshanlai@gmail.com>
2016-01-28 15:48:43 +08:00
Xu Wang e6cffd9add Merge pull request #39 from laijs/escape
handle all escaped character correctly
2016-01-16 08:04:50 +08:00
Lai Jiangshan 213a00ec5e handle all escaped character correctly
Signed-off-by: Lai Jiangshan <jiangshanlai@gmail.com>
2016-01-15 22:36:12 +08:00
Lai Jiangshan c03c057a42 Merge pull request #37 from gao-feng/escape
handle escaped characters
2016-01-15 21:59:44 +08:00
Gao feng 73849713e8 handle escaped characters
./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>
2016-01-14 11:12:33 +08:00
Lai Jiangshan 0610a4e156 Merge pull request #31 from gao-feng/exit
send out exec exit code
2016-01-07 16:44:17 +08:00
Gao feng 29efaadf0a send out exec exit code
Signed-off-by: Gao feng <omarapazanadi@gmail.com>
2016-01-06 00:12:30 +08:00
feisky 02ba85f8e0 Merge pull request #36 from gao-feng/scsi
find scsi disk device if scsi addr is given
v0.3
2015-12-25 10:36:11 +08:00
Gao feng d563b3ecb0 Merge pull request #34 from wcwxyz/master
Use configure script to check setns function
2015-12-24 16:05:37 +08:00
Gao feng ce0ab6b836 find scsi disk device if scsi addr is given
scsi disk name is not consistent with scsi addr. find the
device through scsi addr.

Signed-off-by: Gao feng <omarapazanadi@gmail.com>
2015-12-24 15:59:05 +08:00
feisky feedb0808b Merge pull request #35 from gao-feng/close
do not close pipe in write side
2015-12-24 10:42:05 +08:00
Gao feng c14737f39c do not close pipe in write side
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>
2015-12-23 17:07:07 +08:00
WANG Chao 4b6375a4a4 Use configure script to check setns function
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>
2015-12-22 15:58:45 +08:00
Lai Jiangshan bfa1af2101 Merge pull request #33 from gao-feng/tty
some update
2015-12-11 16:54:44 +08:00
Gao feng a866e257fd update to v0.3
Signed-off-by: Gao feng <omarapazanadi@gmail.com>
2015-12-10 21:00:10 +08:00
Gao feng d34656475e kill process in destroy pod
hyper send destroy pod to shutdown vm, we should
give process a chance to handle TERM signal.

Signed-off-by: Gao feng <omarapazanadi@gmail.com>
2015-12-10 15:13:12 +08:00
Gao feng 2b1edeceb4 introduce hyper_send_msg_block
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>
2015-12-10 14:57:16 +08:00
Gao feng f49d1247d2 Merge pull request #32 from wcwxyz/master
define setns syscall wrapper to fix build issue
2015-12-07 10:29:15 +08:00
WANG Chao ee697391d6 define setns syscall wrapper to fix build issue
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>
2015-12-03 15:50:15 +08:00