Skip to content

Add AF_VSOCK

Choung Park requested to merge cspark-gitlab/libxcb:master into master

This patch extends the existing libxcb protocol framework for AF_VSOCK by adding a new protocol name 'vsock':

DISPLAY=vsock/[<VMADDR_CID>]:<display_number>[.<screen_number>]

For example, in order to have X11 clients running in a virtual machine forwarded to the X11 server running in the host, you can set the DISPLAY variable as:

export DISPLAY=vsock/2:0.0

It can be shortened as the following:

export DISPLAY=vsock/:0

'2' is the assigned number for VMADDR_CID_HOST and it's used as a default value when it's not found in the DISPLAY variable. For a port number, it can be any 'unsigned int', but in order to maintain consistency, it's defined the same as the TCP method: 6000 + <display_number>.

See also: https://stefano-garzarella.github.io/posts/2019-11-08-kvmforum-2019-vsock/ https://man7.org/linux/man-pages/man7/vsock.7.html https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/uapi/linux/vm_sockets.h

Merge request reports

Loading