Commit Graph

223 Commits

Author SHA1 Message Date
Lai Jiangshan 48e7b27737 rename container_parse_cmd() to container_parse_argv()
and take struct hyper_exec as its first argument.

Signed-off-by: Lai Jiangshan <jiangshanlai@gmail.com>
2016-04-07 12:17:50 +08:00
Lai Jiangshan 1cff207e67 kill all exec rather than only container in hyper_term_all()
Signed-off-by: Lai Jiangshan <jiangshanlai@gmail.com>
2016-04-06 15:03:52 +08:00
Lai Jiangshan aa50e5812b move envs to struct hyper_exec
Signed-off-by: Lai Jiangshan <jiangshanlai@gmail.com>
2016-04-06 14:59:08 +08:00
Lai Jiangshan 64cbfd2a0b move workdir to struct hyper_exec
Signed-off-by: Lai Jiangshan <jiangshanlai@gmail.com>
2016-04-06 14:19:15 +08:00
Lai Jiangshan e487303205 rename container_free_cmd() to container_cleanup_exec()
Signed-off-by: Lai Jiangshan <jiangshanlai@gmail.com>
2016-04-06 13:56:11 +08:00
Lai Jiangshan 5a91148a37 remove unused var path
Signed-off-by: Lai Jiangshan <jiangshanlai@gmail.com>
2016-04-06 12:52:25 +08:00
Lai Jiangshan 6a56562120 require exec->seq be set, we can't handle zero seq well
Signed-off-by: Lai Jiangshan <jiangshanlai@gmail.com>
2016-04-06 12:06:04 +08:00
Lai Jiangshan 8803fa8ccb move symlink of devices to container_setup_mount()
Signed-off-by: Lai Jiangshan <jiangshanlai@gmail.com>
2016-04-06 10:35:50 +08:00
Lai Jiangshan 90998a9b21 Merge pull request #67 from bergwolf/no-init
recreate docker init layer files
2016-04-05 10:56:17 +08:00
Peng Tao 5e945d507e recreate docker init layer files
So that it is possible for the container creation code to skip
the init layer all together.

Signed-off-by: Peng Tao <bergwolf@gmail.com>
2016-04-05 03:09:53 +08:00
Lai Jiangshan c1023f414f Merge pull request #68 from gao-feng/copy
Copy
2016-04-04 23:58:21 +08:00
Gao feng e737392fc4 copy: symlink sh and tar to busybox
Signed-off-by: Gao feng <omarapazanadi@gmail.com>
2016-04-04 23:22:42 +08:00
Gao feng 01a09c9b8f copy: remove .oldroot prefix for busybox path
Signed-off-by: Gao feng <omarapazanadi@gmail.com>
2016-04-04 23:20:56 +08:00
Gao feng a524b04f8c copy: return error when exec copy failed
Signed-off-by: Gao feng <omarapazanadi@gmail.com>
2016-04-04 23:20:23 +08:00
Gao feng 2332d39620 Merge pull request #66 from laijs/setup-rootfs-before-chroot
Setup mounts&rootfs before chroot
2016-04-04 10:18:19 -05:00
Lai Jiangshan bc28dfedf8 remove prefix from hyper_find_sd()
we always use the intial /sys, so we don't need prefix

Signed-off-by: Lai Jiangshan <jiangshanlai@gmail.com>
2016-04-03 22:47:09 +08:00
Lai Jiangshan 09c0a1b41b remove oldroot
Signed-off-by: Lai Jiangshan <jiangshanlai@gmail.com>
2016-04-03 22:41:27 +08:00
Lai Jiangshan b441c1bffe do container_setup_dns() before move the rootfs
Signed-off-by: Lai Jiangshan <jiangshanlai@gmail.com>
2016-04-03 19:09:11 +08:00
Lai Jiangshan 5be2a71a84 do container_setup_volume() before move the rootfs
Signed-off-by: Lai Jiangshan <jiangshanlai@gmail.com>
2016-04-03 16:52:14 +08:00
Lai Jiangshan 8766f77f24 do container_setup_mount() before move the rootfs
Signed-off-by: Lai Jiangshan <jiangshanlai@gmail.com>
2016-04-03 16:34:08 +08:00
Lai Jiangshan e4beaad672 Merge pull request #65 from gao-feng/nondocker
create volume directory for non docker volume
2016-04-03 13:39:42 +08:00
Gao feng 7f6056fc4c create volume directory for non docker volume
Signed-off-by: Gao feng <omarapazanadi@gmail.com>
2016-04-03 12:26:24 +08:00
Lai Jiangshan 5ceb9b8906 Merge pull request #64 from gao-feng/volume
don't copy data to volume if volume alreay has data
2016-04-02 22:09:35 +08:00
Gao feng 2ace93e881 don't copy data to volume if volume alreay has data
Signed-off-by: Gao feng <omarapazanadi@gmail.com>
2016-04-02 20:22:51 +08:00
Gao feng abd52a4ae2 Merge pull request #63 from laijs/remove-oldroot-from-mount-source
Remove '/.oldroot' from mount source
2016-04-02 05:22:59 -05:00
Lai Jiangshan 76bccbd261 remove "/.oldroot" from mount source
before patch:
root@test-container-multi:/# mount
/dev/sdb on / type xfs (rw,relatime,attr2,inode64,logbsize=64k,sunit=128,swidth=128,noquota)
/.oldroot/dev/sda on /var/log type ext4 (rw,relatime,stripe=16,data=ordered)

after patch:
root@test-container-multi:/# mount
/dev/sdb on / type xfs (rw,relatime,attr2,inode64,logbsize=64k,sunit=128,swidth=128,noquota)
/dev/sda on /var/log type ext4 (rw,relatime,stripe=16,data=ordered)

Signed-off-by: Lai Jiangshan <jiangshanlai@gmail.com>
2016-04-02 17:52:25 +08:00
Lai Jiangshan 8f70de4d49 change the order of basic mount and volume mount
Signed-off-by: Lai Jiangshan <jiangshanlai@gmail.com>
2016-04-02 17:46:51 +08:00
Lai Jiangshan ea196f786d move mount of fsmap into container_setup_volume()
Signed-off-by: Lai Jiangshan <jiangshanlai@gmail.com>
2016-04-02 17:41:55 +08:00
Gao feng ced3b9dc53 Merge pull request #62 from laijs/mkdir
print mkdir info in correct order
2016-04-02 01:04:35 -05:00
Gao feng 5ca0595e4f Merge pull request #61 from laijs/ptys
fix symlink leek
2016-04-02 01:04:19 -05:00
Gao feng 53cd58a121 Merge pull request #60 from laijs/msmove
Set the rootfs of the namespace to be the rootfs of the container
2016-04-01 23:05:40 -05:00
Lai Jiangshan 0a86f73869 Set the rootfs of the namespace to be the rootfs of the container
we use MS_MOVE to move the container rootfs to /, so that the rootfs
of the namespace and the rootfs of the container are the same.

Signed-off-by: Lai Jiangshan <jiangshanlai@gmail.com>
2016-04-02 11:54:14 +08:00
Lai Jiangshan 12ba0a42b2 print mkdir info in correct order
and only print it when it is needed to be maked.

Signed-off-by: Lai Jiangshan <jiangshanlai@gmail.com>
2016-04-02 11:37:06 +08:00
Lai Jiangshan 1ad3ffcf63 close ptymaster before exec
ptymaster is dup-ed without close-on-exec, we need to colse it.

Signed-off-by: Lai Jiangshan <jiangshanlai@gmail.com>
2016-04-02 11:29:15 +08:00
Lai Jiangshan 5f9a7ee0a2 reopen slave ptyfd for correcting the symlink path of the /dev/fd/1
before patch:
root@ubuntu-4562002641:/# readlink /dev/fd/1
/tmp/hyper/656f914cd9c030214bf95aff8f3bf418c1c277f5b82a661a27a174c9c8ce901b/devpts/3

after patch:
root@ubuntu-5512501784:/# readlink /dev/fd/1
/dev/pts/1

Signed-off-by: Lai Jiangshan <jiangshanlai@gmail.com>
2016-04-02 11:10:48 +08:00
Gao feng b0c0255148 Merge pull request #58 from gao-feng/initialize
support to initialize container environment
2016-04-01 21:48:51 -05:00
Gao feng 6b67c6a296 Merge pull request #59 from laijs/mount-rootfs
ensure the container see the mount point of the rootfs
2016-04-01 05:54:48 -05:00
Lai Jiangshan 0017a6110f ensure the container see the mount point of the rootfs
Signed-off-by: Lai Jiangshan <jiangshanlai@gmail.com>
2016-04-01 18:28:32 +08:00
Gao feng 6bbb9ac512 support to initialize container environment
Signed-off-by: Gao feng <omarapazanadi@gmail.com>
2016-04-01 16:48:26 +08:00
Xu Wang 6feb864e30 Merge pull request #57 from feiskyer/fix-cache
Do not cache for shared volumes
2016-03-29 11:34:50 +08:00
feisky 6ff04bf83d Do not cache for shared volumes 2016-03-28 17:45:00 +08:00
Lai Jiangshan 80778ddd25 Merge pull request #56 from laijs/pipe2
convert hyper_socketpair() to pipe2
2016-03-28 08:15:03 +08:00
Lai Jiangshan c455e8bc75 convert hyper_socketpair() to pipe2
Signed-off-by: Lai Jiangshan <jiangshanlai@gmail.com>
2016-03-26 18:23:03 +08:00
feisky 411cffdeec Merge pull request #55 from laijs/env
fix up default environment
2016-03-26 12:12:01 +08:00
Lai Jiangshan 04689c4138 set HOSTNAME environment
Signed-off-by: Lai Jiangshan <jiangshanlai@gmail.com>
2016-03-26 12:03:15 +08:00
Lai Jiangshan 50928fc1ef set/unset TERM environment based on tty config
Signed-off-by: Lai Jiangshan <jiangshanlai@gmail.com>
2016-03-26 11:44:37 +08:00
Lai Jiangshan 20c34a4312 set HOME environment
Signed-off-by: Lai Jiangshan <jiangshanlai@gmail.com>
2016-03-26 11:39:36 +08:00
Gao feng fdd2634721 Merge pull request #54 from liusdu/typo
fix a tiny typo to avoid compile error
2016-03-19 14:23:00 +00:00
Liu Hua b043ac88e1 fix a tiny typo to avoid compile error
Signed-off-by: Liu Hua <sdu.liu@huawei.com>
2016-03-19 22:03:28 +08:00
Gao feng 5c18914f2a Merge pull request #53 from laijs/handle-eof
Handle eof
2016-03-18 22:25:14 -05:00