vsock

package
v0.5.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 30, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package vsock provides Go net.Conn adapters for Virtio socket connections and helpers for connecting to a guest over vsock.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conn

type Conn struct {
	// contains filtered or unexported fields
}

Conn wraps a Virtio socket connection as a net.Conn.

func NewConn

func NewConn(vzConn vz.VZVirtioSocketConnection) (*Conn, error)

NewConn converts a Virtio socket connection into a net.Conn.

func (*Conn) Close

func (c *Conn) Close() error

func (*Conn) LocalAddr

func (c *Conn) LocalAddr() net.Addr

func (*Conn) Read

func (c *Conn) Read(b []byte) (int, error)

func (*Conn) RemoteAddr

func (c *Conn) RemoteAddr() net.Addr

func (*Conn) SetDeadline

func (c *Conn) SetDeadline(t time.Time) error

func (*Conn) SetReadDeadline

func (c *Conn) SetReadDeadline(t time.Time) error

func (*Conn) SetWriteDeadline

func (c *Conn) SetWriteDeadline(t time.Time) error

func (*Conn) Write

func (c *Conn) Write(b []byte) (int, error)

type Manager

type Manager struct {

	// DispatchFunc runs Virtualization calls on the VM's queue.
	DispatchFunc func(fn func())
	// contains filtered or unexported fields
}

Manager manages the first Virtio socket device on a running VM.

func NewManager

func NewManager(machine vz.VZVirtualMachine) (*Manager, error)

NewManager wraps the first Virtio socket device from a running VM.

func (*Manager) Connect

func (m *Manager) Connect(port uint32) (net.Conn, error)

Connect establishes a vsock connection to port.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL