mdlayher / vsock

Package vsock provides access to Linux VM sockets (AF_VSOCK) for communication between a hypervisor and its virtual machines. MIT Licensed.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

vhost-user-vsock

aep opened this issue · comments

vhost-user-vsock implements vsocks as uds on the host.

i wonder what it takes to implement that in this package.
there appears to be a rust impl

https://github.com/rust-vmm/vhost-device/pull/7/files

but i'm not sure if thats the correct layer

Hey there, I have very little context as to what this actually is or what sort of use cases it solves. It's my understanding that the virtio-vsock device with qemu is the defacto solution but would this be for communicating between local processes on the same machine? If so then more recent versions of the vsock kernel modules support loopback communication on the same host.

I just ask because I am a bit removed from the space and would like to understand the use cases for the feature here, and what sort of APIs you'd expect to see. Thanks!

ah, sorry!

normally vsock is implemented by using the host kernel vsock implementation. i.e. the host just opens a socket with AF_VSOCK. However, that's not safe in multi tenancy situations where you don't trust the VMs, so that's what vhost-user-vsock is for.

It implements the host side as vhost-user unix domain socket. the pull request i linked contains an example implementation in rust. Unfortunately i dont know much more either. it looks like vhost-user is fairly complex and i couldnt find a golang implementation of it. It's likely not worth it implementing it in go-vsock if the base vhost-user impl doesnt exist

No worries! We can leave this open for tracking but yeah it seems like a lot more plumbing would be required.