-
Notifications
You must be signed in to change notification settings - Fork 63
Vsock support #249
Vsock support #249
Conversation
build/Dockerfile
Outdated
| RUN yum install -y patch gcc ncurses-devel make openssl-devel bc | ||
|
|
||
| ENV KERNEL_VERSION 4.4.28 | ||
| ENV KERNEL_VERSION 4.8.10 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
4.9.x will be longterm support. 4.9.1 will be released in one or two weeks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great! We should use 4.9.y in the long run then.
32e51a7 to
e62bcb8
Compare
|
ci failure seems to relate to aufs |
Signed-off-by: Peng Tao <bergwolf@gmail.com>
e62bcb8 to
c9b3e39
Compare
|
travis failed with |
|
|
||
| AC_CHECK_FILE([/usr/include/linux/vm_sockets.h], | ||
| [], [AC_MSG_ERROR(Cannot find linux/vm_sockets.h)]) | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It shouldn't stop the build when there is no /usr/include/linux/vm_sockets.h, please just disable the VSOCK in this case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done. Now vsock is built only when /usr/include/linux/vm_sockets.h is present.
.travis.yml
Outdated
| before_install: | ||
| - sudo apt-get update -qq | ||
| - sudo apt-get install -y autoconf automake pkg-config libdevmapper-dev libsqlite3-dev libvirt-dev qemu libvirt-bin -qq | ||
| - sudo apt-get install -y autoconf automake pkg-config libdevmapper-dev libsqlite3-dev libvirt-dev qemu libvirt-bin -qq linux-headers-$(uname -r) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please change the position of -qq.
sudo apt-get install -y -qq
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
| CONFIG_CGROUP_DEVICE=y | ||
| CONFIG_CPUSETS=y | ||
| CONFIG_PROC_PID_CPUSET=y | ||
| CONFIG_CGROUP_CPUACCT=y |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why cgroup is disabled?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, find it :)
67ab098 to
f2a008a
Compare
src/init.c
Outdated
| } else if (hyper_cmd("modprobe vmw_vsock_virtio_transport") < 0) { | ||
| fprintf(stderr, "fail to load vmw_vsock_virtio_transport.ko\n"); | ||
| } else { | ||
| hyper_epoll.vsock_ctl_listener.fd = 1; /* >0 indicates vsock support */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is better to use a local var.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
src/init.c
Outdated
| cmdline = read_cmdline(); | ||
|
|
||
| setenv("PATH", "/bin:/sbin/:/usr/bin/:/usr/sbin/", 1); | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the env is set in hyper_setup_init_process()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed.
Signed-off-by: Peng Tao <bergwolf@gmail.com>
listen control channel on port 2718, and message channel on 2719. Signed-off-by: Peng Tao <bergwolf@gmail.com>
Signed-off-by: Peng Tao <bergwolf@gmail.com>
Set up control channel and message channel if unset yet. Signed-off-by: Peng Tao <bergwolf@gmail.com>
Signed-off-by: Peng Tao <bergwolf@gmail.com>
To have larger buffer size and also handle HUP events so that it is possible to reconnect to hyperstart. Signed-off-by: Peng Tao <bergwolf@gmail.com>
Signed-off-by: Peng Tao <bergwolf@gmail.com>
So that we know when runv closes a connection. Signed-off-by: Peng Tao <bergwolf@gmail.com>
1. when read returns 0, it means remotes has closed socket, for normal TCP connections. 2. when read returns -ENOTCONN for vsock, it means remote has closed the socket. We should be able to just handle case 1) if we patch vsock kernel implementation to match normal TCP connection behavior. Signed-off-by: Peng Tao <bergwolf@gmail.com>
Signed-off-by: Peng Tao <bergwolf@gmail.com>
Now we need linux-headers to build as vsock requires <linux/vm_sockets.h>. But ubuntu saves it to /usr/src/linux-headers-$(uname -r)/include/uapi in its linux-headers package. Need to move it to /usr/include/linux manually because one cannot include the uapi directory directly. Signed-off-by: Peng Tao <bergwolf@gmail.com>
nonblock_read() relies errno being 0 upon entering, and also does not want to return -EINTR. Signed-off-by: Peng Tao <bergwolf@gmail.com>
If we cannot find /usr/include/linux/vm_sockets.h locally, do not build with vsock support. Signed-off-by: Peng Tao <bergwolf@gmail.com>
Signed-off-by: Peng Tao <bergwolf@gmail.com>
f2a008a to
0dbe3f7
Compare
The PR rebases #194 on top of latest master. It does the following:
TODO: after rebase, control channel writer buffer needs to be preserved across dissociate/associate. I will add it later but it is not a blocker for this PR. vsock is optional and should not break serial port code. So I'd like to get the PR reviewed/merged first as it is already large enough.