vsock

package
v5.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Rendered for windows/amd64

Index

Constants

View Source
const (
	// HvsockMachineName is the string identifier for the machine name in a registry entry
	HvsockMachineName = "MachineName"
	// HvsockPurpose is the string identifier for the sock purpose in a registry entry
	HvsockPurpose = "Purpose"
	// VsockRegistryPath describes the registry path to where the hvsock registry entries live
	VsockRegistryPath = `SOFTWARE\Microsoft\Windows NT\CurrentVersion\Virtualization\GuestCommunicationServices`
	// LinuxVM is the default guid for a Linux VM on Windows
	LinuxVM = "FACB-11E6-BD58-64006A7986D3"
)

Variables

View Source
var ErrVSockRegistryEntryExists = errors.New("registry entry already exists")

Functions

This section is empty.

Types

type HVSockPurpose

type HVSockPurpose int

HVSockPurpose describes what the hvsock is needed for

const (
	// Network implies the sock is used for user-mode networking
	Network HVSockPurpose = iota
	// Events implies the sock is used for notification (like "Ready")
	Events
	// Fileserver implies that the sock is used for serving files from host to VM
	Fileserver
)

func (HVSockPurpose) Equal

func (hv HVSockPurpose) Equal(purpose string) bool

type HVSockRegistryEntry

type HVSockRegistryEntry struct {
	KeyName     string        `json:"key_name"`
	Purpose     HVSockPurpose `json:"purpose"`
	Port        uint64        `json:"port"`
	MachineName string        `json:"machineName"`
	Key         registry.Key  `json:"key,omitempty"`
}

HVSockRegistryEntry describes a registry entry used in Windows for HVSOCK implementations

func LoadHVSockRegistryEntry

func LoadHVSockRegistryEntry(port uint64) (*HVSockRegistryEntry, error)

func NewHVSockRegistryEntry

func NewHVSockRegistryEntry(machineName string, purpose HVSockPurpose) (*HVSockRegistryEntry, error)

NewHVSockRegistryEntry is a constructor to make a new registry entry in Windows. After making the new object, you must call the add() method to *actually* add it to the Windows registry.

func (*HVSockRegistryEntry) Add

func (hv *HVSockRegistryEntry) Add() error

Add creates a new Windows registry entry with string values from the HVSockRegistryEntry.

func (*HVSockRegistryEntry) ListenSetupWait

func (hv *HVSockRegistryEntry) ListenSetupWait() (func() error, io.Closer, error)

ListenSetupWait creates an hvsock on the windows side and returns a wait function that, when called, blocks until it receives a ready notification on the vsock

func (*HVSockRegistryEntry) Listener

func (hv *HVSockRegistryEntry) Listener() (net.Listener, error)

Listener returns a net.Listener for the given HvSock.

func (*HVSockRegistryEntry) Remove

func (hv *HVSockRegistryEntry) Remove() error

Remove deletes the registry key and its string values

Jump to

Keyboard shortcuts

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