linuxkit / virtsock

Go bindings for virtio and Hyper-V sockets
Other
87 stars 29 forks source link

Support Darwin and AF_VSOCK. #2

Closed ijc closed 7 years ago

ijc commented 7 years ago

Significantly refactor to support vsock and Darwin. Matrix is:

        | hvsock | vsock |
--------+--------+-------+
Darwin  |        |   X   |
Linux   |   X    |   X   |
Windows |   X    |       |

Linux tries to autodetect AF_VSOCK vs AF_HYPERV but can be overridden with -m vsock or -m hvsock.

Darwin assumes Hyperkit as configured by Docker for Mac, but can be overridden with e.g. -m hyperkit:/some/path for standalone hyperkit.

Add a README to explain how to run things. Note that I have only build tested for Windows and it remains undocumented.

Signed-off-by: Ian Campbell ian.campbell@docker.com

ijc commented 7 years ago

Of particular note above:

Note that I have only build tested for Windows and it remains undocumented.

ijc commented 7 years ago

I meant to mention this in the commit message but forgot: It was easier to add a verbosity option to hvgoecho than to faff around refactoring it even further to allow only hvgostress to have the option.

ijc commented 7 years ago
rn commented 7 years ago

Thanks. Very useful.

I tried testing hvgostress on the Windows side:

rn commented 7 years ago

Doh, forgot that I didn't implement accept() on Windows due to issues with connecting from the VM to the host. Since the host->Linux VM works on Windows. Merging this.