Skip to content
This repository was archived by the owner on Feb 8, 2021. It is now read-only.

Conversation

@bergwolf
Copy link
Member

@bergwolf bergwolf commented Jan 5, 2017

The PR rebases #194 on top of latest master. It does the following:

  1. Add vsock kernel support
  2. Listen and create vsock channels for control and tty messages
  3. Support associate/dissociate by accepting new control channels after previous one is closed

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.

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
Copy link
Contributor

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.

Copy link
Member Author

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.

@bergwolf bergwolf force-pushed the vsock-rebased branch 6 times, most recently from 32e51a7 to e62bcb8 Compare January 6, 2017 07:18
@bergwolf
Copy link
Member Author

bergwolf commented Jan 6, 2017

ci failure seems to relate to aufs

^JW0106 07:24:58.419114   22217 aufs.go:177] Couldn't run auplink command : exit status 22
^J%!s(MISSING)
^JE0106 07:24:58.419180   22217 storage.go:287] got error when mount container to share dir Fail to mount aufs dir to /var/run/hyper/vm-zEBMLRocZR/share_dir/271590cefbd5c05ab936484c9ca731ece0ecd3dedaef8cf41690a614cb0ec798/rootfs: invalid argument
^JE0106 07:24:58.419223   22217 container.go:864] Pod[test-container-volume] Con[4e362172b30b(c2)] failed to prepare rootfs: Fail to mount aufs dir to /var/run/hyper/vm-zEBMLRocZR/share_dir/271590cefbd5c05ab936484c9ca731ece0ecd3dedaef8cf41690a614cb0ec798/rootfs: invalid argument

Signed-off-by: Peng Tao <bergwolf@gmail.com>
@bergwolf
Copy link
Member Author

travis failed with The log length has exceeded the limit of 4 MB.


AC_CHECK_FILE([/usr/include/linux/vm_sockets.h],
[], [AC_MSG_ERROR(Cannot find linux/vm_sockets.h)])

Copy link
Contributor

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.

Copy link
Member Author

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)
Copy link
Contributor

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

Copy link
Member Author

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why cgroup is disabled?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, find it :)

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 */
Copy link
Contributor

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.

Copy link
Member Author

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);

Copy link
Contributor

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()

Copy link
Member Author

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>
@laijs laijs merged commit 544e11f into hyperhq:master Mar 1, 2017
@bergwolf bergwolf deleted the vsock-rebased branch May 8, 2017 07:49
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants