Skip to content

Major rewrite of 'pkg/hvsock' and some other changes #53

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 15 commits into from
Feb 2, 2018
Merged

Conversation

rn
Copy link
Member

@rn rn commented Jan 31, 2018

This PR contains several breaking changes and removes support for Windows build before 10586. There is a new tag end_10586_support which should be used to access the latest older version.

  • Remove the hack we used to emulate shutdown() (CloseRead()/CloseWrite() in go speak). This should be supported in windows build 14393 an newer as well as the 4.9.x and 4.14.x implementation.
  • At the same time restructure the hvsock code to have the windows and linux implementation mostly separate.
  • Implement Accept()/Listen() on Windows (resolves Implement accept()/Listen() for windows #52).
  • Quite a few go lint changes both in pkg/vsock and pkg/hvsock. Note this changed the API and adjustments were made to vsudd and sock_stress.
  • Updated documentation with instructions for Windows and more limitations.
  • Modify vsudd to also work on newer kernels

All changes have been tested with both the 4.9.x and the 4.14.x kernel implementations (which are different).

rn added 15 commits January 31, 2018 16:47
Windows builds newer than 10586 should support shutdown() (ie
CloseRead()/CloseWrite()) and should also handle larger
Read()/Write() data.

Remove all the clutches we implemented to support older
Windows versions, including the "protocol" we placed on
top of the raw Hyper-V sockets to emulated then unsupported
functionality.

Note, we also removed the workaround in hvsock to use vsock
on Linux if the kernel supports it.

Signed-off-by: Rolf Neugebauer <[email protected]>
The Hyper-V socket implementation in 4.9.x kernels seems
to only be able to handle smaller messages while the newer
4.14.x implementation seems to be doing fine with larger
messages.

This temporary workaround liites how much we write with one call
to Write() to 8k which we found through experimentation to work.

Signed-off-by: Rolf Neugebauer <[email protected]>
Make the struct implementing the hvsock internals internal.
It doesn't need to be exported as we export the interface.

Also move some constants to zsyscall_windows.go which should
be skipped by linters anyway (not sure they do, but they should).

Signed-off-by: Rolf Neugebauer <[email protected]>
Make the struct implementing the vsock internals internal.
It doesn't need to be exported as we export the interface.

Signed-off-by: Rolf Neugebauer <[email protected]>
It is no longer supported

Signed-off-by: Rolf Neugebauer <[email protected]>
It's already namespaced by the package anyway.

Note this is a API breaking change

Signed-off-by: Rolf Neugebauer <[email protected]>
It's already namespaced by the package anyway.

Note this is a API breaking change

Signed-off-by: Rolf Neugebauer <[email protected]>
Signed-off-by: Rolf Neugebauer <[email protected]>
Defaults to true on Windows. On Linux, it tried to open
a hvsock and if it fails returns false.

This function can be used by Linux clients to determine if they should
use vsock or hvsock when using Hyper-V sockets.

Signed-off-by: Rolf Neugebauer <[email protected]>
Previously, 'pkg/hvosck' used to select either vsock or hvsock
based on the Linux kernel. This auto-select was removed from
'pkg/hvsock'. Move the logic into the main sock_stress
code instead.

Signed-off-by: Rolf Neugebauer <[email protected]>
Note, this commit contains a minor unrelated change in
Dial() which can't easily be rebased to the correct
commit as the code has changed in between.

Signed-off-by: Rolf Neugebauer <[email protected]>
- Add notes on how to run on Windows
- Clarify limitations

Signed-off-by: Rolf Neugebauer <[email protected]>
@rn rn mentioned this pull request Jan 31, 2018
@rn rn merged commit db93468 into linuxkit:master Feb 2, 2018
@rn rn deleted the remove branch February 2, 2018 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement accept()/Listen() for windows Remove support for Hyper-V socket pre Windows build 14393
1 participant