zeromq / libzmq

ZeroMQ core engine in C++, implements ZMTP/3.1
https://www.zeromq.org
Mozilla Public License 2.0
9.75k stars 2.36k forks source link

VSOCK support #4491

Open achimnol opened 1 year ago

achimnol commented 1 year ago

Issue description

I'd like to make a feature request to explicitly add support for AF_VSOCK sockets, as the form of vsock://CID:PORT.

VSOCK is used to implement IPC between VMs and containers without extra network configurations in Linux systems. For instance, VSOCK can replace the use of UNIX domain socket bind-mounts between containers and the host.

A particular usage scenarios is Docker Desktop for Mac. With its recent 4.15 release (December 2022), it has changed the filesystem sharing driver to virtiofs which does not support bind-mounting UNIX sockets crossing the macOS filesystem and the QEMU VM's filesystem.

A good workaround of this situation is to use VSOCK, which is well-supproted by the QEMU's virtio stack and many other Linux hypervisors.

This is a relatively new kernel feature, though this originates from VMCI which zeromq already has some integration with. I think the actual implementation should not be much difficult.

Environment

bluca commented 1 year ago

Can you send a PR to implement it?