-r == read from the vsock
-w == write to the vsock
This makes it easier to write automated test cases.
Signed-off-by: Ian Campbell <ian.campbell@docker.com>
Rather than exiting when the first read hits EOF, ignoring any remaining data
going the other way.
Signed-off-by: Ian Campbell <ian.campbell@docker.com>
These are WIP taken from git@github.com:stefanha/linux.git#vsock
(==4c9d2a6be1c6, using "cherry-pick -x") and correspond to RFC v5 of the
frontend patches posted in
http://thread.gmane.org/gmane.linux.kernel.virtualization/27455
There is no corresponding spec proposal update yet, but this set of patches
correspond (roughly) to addressing the feedback on v4 of the spec proposal
http://thread.gmane.org/gmane.comp.emulators.virtio.devel/1062.
kernel_config.arm modifications copied from x86, not tested.
Added /etc/kernel-patches/ directory to the image to be consumed by the
licensing.
Signed-off-by: Ian Campbell <ian.campbell@docker.com>
This filesystem can be used to add and remove host port forwards e.g.
mkdir /port/test
echo -n '127.0.0.1:80:127.0.0.1:80' >> /port/test/ctl
RESULT=$(cat /port/test/ctl)
Signed-off-by: David Scott <dave.scott@docker.com>
When requesting a port forward we currently need to know the VM's
address from the point of view of the port forwarder. The easiest way to
discover this is to read it from the existing "docker" port forward.
Note this should all be revamped once we have vsock support.
Signed-off-by: David Scott <dave.scott@docker.com>
This patch removes `proxyForever` and adds `sendError` and `sendOK` for
signalling to the parent process. The main function now sequences these
functions and calls stub functions `exposePort` and `unexposePort` which
will be hooked up in a later patch.
Signed-off-by: David Scott <dave.scott@docker.com>
Previously the proxy.go would directly call `os.Exit`. This patch
causes control to return to `main` where we can tear down any port
forward.
Signed-off-by: David Scott <dave.scott@docker.com>
Previously `execProxy` would
- create the proxy
- signal success/failure to the parent
- run forever (until signalled)
Since we want to add more proxy setup and teardown, this patch
removes the proxy creation from `execProxy` and renames it to
`proxyForever`. Later patches will be able to perform the necessary
side-effects before signalling success to the parent.
Signed-off-by: David Scott <dave.scott@docker.com>
A client like `pinata diagnose` can do the equivalent of:
nc 192.168.64.2 62374 > foo.tar
and find `foo.tar` contains
- the output of `/usr/bin/diagnostics`
- `iptables -L`
- `netstat -an`
- `ps uax`
- `docker ps`
- `dig docker.com`
- `wget http://docker.com`
This will allow us to diagnose various in-VM faults, without having
to ask the user to access the console and run commands.
Signed-off-by: David Scott <dave.scott@docker.com>