hyperv

package
v4.9.4 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2024 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Rendered for windows/amd64

Index

Constants

View Source
const (
	// Some of this will need to change when we are closer to having
	// working code.
	VolumeTypeVirtfs = "virtfs"
	MountType9p      = "9p"
)
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

func VirtualizationProvider added in v4.7.0

func VirtualizationProvider() machine.VirtProvider

Types

type HVSockPurpose added in v4.6.0

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 added in v4.6.0

func (hv HVSockPurpose) Equal(purpose string) bool

type HVSockRegistryEntry added in v4.6.0

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 added in v4.6.0

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

func NewHVSockRegistryEntry added in v4.6.0

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 added in v4.6.0

func (hv *HVSockRegistryEntry) Add() error

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

func (*HVSockRegistryEntry) Listen added in v4.6.0

func (hv *HVSockRegistryEntry) Listen() error

Listen is used on the windows side to listen for anything to come over the hvsock as a signal the vm is booted

func (*HVSockRegistryEntry) Listener added in v4.8.0

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

Listener returns a net.Listener for the given HvSock.

func (*HVSockRegistryEntry) Remove added in v4.6.0

func (hv *HVSockRegistryEntry) Remove() error

Remove deletes the registry key and its string values

type HyperVMachine

type HyperVMachine struct {
	// ConfigPath is the fully qualified path to the configuration file
	ConfigPath define.VMFile
	// HostUser contains info about host user
	machine.HostUser
	// ImageConfig describes the bootable image
	machine.ImageConfig
	// Mounts is the list of remote filesystems to mount
	Mounts []machine.Mount
	// Name of VM
	Name string
	// NetworkVSock is for the user networking
	NetworkHVSock HVSockRegistryEntry
	// ReadySocket tells host when vm is booted
	ReadyHVSock HVSockRegistryEntry
	// ResourceConfig is physical attrs of the VM
	machine.ResourceConfig
	// SSHConfig for accessing the remote vm
	machine.SSHConfig
	// Starting tells us whether the machine is running or if we have just dialed it to start it
	Starting bool
	// Created contains the original created time instead of querying the file mod time
	Created time.Time
	// LastUp contains the last recorded uptime
	LastUp time.Time
	// GVProxy will write its PID here
	GvProxyPid define.VMFile
	// MountVsocks contains the currently-active vsocks, mapped to the
	// directory they should be mounted on.
	MountVsocks map[string]uint64
	// contains filtered or unexported fields
}

func (*HyperVMachine) Init

func (m *HyperVMachine) Init(opts machine.InitOptions) (bool, error)

func (*HyperVMachine) Inspect

func (m *HyperVMachine) Inspect() (*machine.InspectInfo, error)

func (*HyperVMachine) Remove

func (m *HyperVMachine) Remove(_ string, opts machine.RemoveOptions) (string, func() error, error)

func (*HyperVMachine) SSH

func (m *HyperVMachine) SSH(name string, opts machine.SSHOptions) error

func (*HyperVMachine) Set

func (m *HyperVMachine) Set(name string, opts machine.SetOptions) ([]error, error)

func (*HyperVMachine) Start

func (m *HyperVMachine) Start(name string, opts machine.StartOptions) error

func (*HyperVMachine) State

func (m *HyperVMachine) State(_ bool) (machine.Status, error)

func (*HyperVMachine) Stop

func (m *HyperVMachine) Stop(name string, opts machine.StopOptions) error

type HyperVVirtualization added in v4.7.0

type HyperVVirtualization struct {
	machine.Virtualization
}

func (HyperVVirtualization) CheckExclusiveActiveVM added in v4.7.0

func (v HyperVVirtualization) CheckExclusiveActiveVM() (bool, string, error)

func (HyperVVirtualization) IsValidVMName added in v4.7.0

func (v HyperVVirtualization) IsValidVMName(name string) (bool, error)

func (HyperVVirtualization) List added in v4.7.0

func (HyperVVirtualization) LoadVMByName added in v4.7.0

func (v HyperVVirtualization) LoadVMByName(name string) (machine.VM, error)

func (HyperVVirtualization) NewMachine added in v4.7.0

func (v HyperVVirtualization) NewMachine(opts machine.InitOptions) (machine.VM, error)

func (HyperVVirtualization) RemoveAndCleanMachines added in v4.7.0

func (v HyperVVirtualization) RemoveAndCleanMachines() error

func (HyperVVirtualization) VMType added in v4.7.0

func (v HyperVVirtualization) VMType() machine.VMType

Jump to

Keyboard shortcuts

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