Documentation
¶
Overview ¶
Package transport opens the guest↔host channel weft-init uses to stream pod status, container events, log chunks, and to receive control requests (stop, exec, restart) from weft-agent on the hypervisor host.
The transport is AF_VSOCK on Linux KVM and on Apple VZ guests (VZVirtioSocketDevice on the host side). Both expose the same kernel-level interface to the guest, so this code is the same for both backends.
Pure stdlib: we open AF_VSOCK via syscall.Socket and speak the raw socket. The weft-proto gRPC service runs over this socket; integration with grpc-go is done in cmd/weft-init wiring (a custom Dialer), not here.
Index ¶
Constants ¶
const ( VsockCIDAny = 0xffffffff // -1 VsockCIDHypervisor = 0 VsockCIDLocal = 1 VsockCIDHost = 2 )
VsockCID values reserved by the kernel.
Variables ¶
This section is empty.
Functions ¶
func Dial ¶
Dial opens an AF_VSOCK connection to (cid, port) and wraps it in a *net.UnixConn-like net.Conn for use with grpc.WithDialer.
Typical use: Dial(VsockCIDHost, 5555) inside the guest to reach weft-agent on the hypervisor host.
func DialWithRetry ¶
DialWithRetry retries Dial up to attempts times with the given per-attempt delay. The host side of vsock isn't always ready the instant the guest finishes booting ; a few hundred ms of retry covers the gap without baking in arbitrary sleeps.
Types ¶
This section is empty.