summaryrefslogtreecommitdiffstats
path: root/man7/vsock.7
diff options
context:
space:
mode:
Diffstat (limited to 'man7/vsock.7')
-rw-r--r--man7/vsock.732
1 files changed, 16 insertions, 16 deletions
diff --git a/man7/vsock.7 b/man7/vsock.7
index f6c3711..3d679c0 100644
--- a/man7/vsock.7
+++ b/man7/vsock.7
@@ -2,14 +2,14 @@
.\"
.\" SPDX-License-Identifier: Linux-man-pages-copyleft
.\"
-.TH vsock 7 2022-10-30 "Linux man-pages 6.05.01"
+.TH vsock 7 2024-02-25 "Linux man-pages 6.7"
.SH NAME
vsock \- Linux VSOCK address family
.SH SYNOPSIS
.nf
.B #include <sys/socket.h>
.B #include <linux/vm_sockets.h>
-.PP
+.P
.IB stream_socket " = socket(AF_VSOCK, SOCK_STREAM, 0);"
.IB datagram_socket " = socket(AF_VSOCK, SOCK_DGRAM, 0);"
.fi
@@ -19,7 +19,7 @@ the host they are running on.
This address family is used by guest agents and
hypervisor services that need a communications channel that is independent of
virtual machine network configuration.
-.PP
+.P
Valid socket types are
.B SOCK_STREAM
and
@@ -31,26 +31,26 @@ provides a connectionless datagram packet service with best-effort delivery and
best-effort ordering.
Availability of these socket types is dependent on the
underlying hypervisor.
-.PP
+.P
A new socket is created with
-.PP
+.P
.in +4n
.EX
socket(AF_VSOCK, socket_type, 0);
.EE
.in
-.PP
+.P
When a process wants to establish a connection, it calls
.BR connect (2)
with a given destination socket address.
The socket is automatically bound to a free port if unbound.
-.PP
+.P
A process can listen for incoming connections by first binding to a socket
address using
.BR bind (2)
and then calling
.BR listen (2).
-.PP
+.P
Data is transmitted using the
.BR send (2)
or
@@ -67,7 +67,7 @@ The CID identifies the source or destination,
which is either a virtual machine or the host.
The port number differentiates between multiple services running on
a single machine.
-.PP
+.P
.in +4n
.EX
struct sockaddr_vm {
@@ -83,7 +83,7 @@ struct sockaddr_vm {
};
.EE
.in
-.PP
+.P
.I svm_family
is always set to
.BR AF_VSOCK .
@@ -100,7 +100,7 @@ capability may
to these port numbers.
.I svm_zero
must be zero-filled.
-.PP
+.P
There are several special addresses:
.B VMADDR_CID_ANY
(\-1U)
@@ -112,7 +112,7 @@ means any address for binding;
.B VMADDR_CID_HOST
(2)
is the well-known address of the host.
-.PP
+.P
The special constant
.B VMADDR_PORT_ANY
(\-1U)
@@ -123,7 +123,7 @@ Connected
.B SOCK_STREAM
sockets become disconnected when the virtual machine migrates to a new host.
Applications must reconnect when this happens.
-.PP
+.P
The local CID may change across live migration if the old CID is
not available on the new host.
Bound sockets are automatically updated to the new CID.
@@ -152,11 +152,11 @@ when binding instead of getting the local CID with
(1) directs packets to the same host that generated them.
This is useful
for testing applications on a single host and for debugging.
-.PP
+.P
The local CID obtained with
.B IOCTL_VM_SOCKETS_GET_LOCAL_CID
can be used for the same purpose, but it is preferable to use
-.B VMADDR_CID_LOCAL .
+.BR VMADDR_CID_LOCAL .
.SH ERRORS
.TP
.B EACCES
@@ -215,7 +215,7 @@ are valid.
Support for VMware (VMCI) has been available since Linux 3.9.
KVM (virtio) is supported since Linux 4.8.
Hyper-V is supported since Linux 4.14.
-.PP
+.P
.B VMADDR_CID_LOCAL
is supported since Linux 5.6.
.\" commit ef343b35d46667668a099655fca4a5b2e43a5dfe