hostdevice

package
v0.47.0-rc.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateMDEVHostDevices

func CreateMDEVHostDevices(hostDevicesData []HostDeviceMetaData, mdevAddrPool AddressPooler) ([]api.HostDevice, error)

func CreatePCIHostDevices

func CreatePCIHostDevices(hostDevicesData []HostDeviceMetaData, pciAddrPool AddressPooler) ([]api.HostDevice, error)

Types

type AddressPool

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

func NewAddressPool

func NewAddressPool(resourcePrefix string, resources []string) *AddressPool

NewAddressPool creates an address pool based on the provided list of resources and the environment variables that correspond to it.

func (*AddressPool) Pop

func (p *AddressPool) Pop(resource string) (string, error)

Pop gets the next address available to a particular resource. The function makes sure that the allocated address is not allocated to next callers, whether they request an address for the same resource or another resource (covering cases of addresses that are share by multiple resources).

type AddressPooler

type AddressPooler interface {
	Pop(key string) (value string, err error)
}

type BestEffortAddressPool

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

func NewBestEffortAddressPool

func NewBestEffortAddressPool(pool AddressPooler) *BestEffortAddressPool

NewBestEffortAddressPool creates a pool that wraps a provided pool and allows `Pop` calls to always succeed (even when a resource is missing).

func (*BestEffortAddressPool) Pop

func (p *BestEffortAddressPool) Pop(resource string) (string, error)

type HostDeviceMetaData

type HostDeviceMetaData struct {
	AliasPrefix  string
	Name         string
	ResourceName string

	// DecorateHook is a function pointer that may be used to mutate the domain host-device
	// with additional specific parameters. E.g. guest PCI address.
	DecorateHook func(hostDevice *api.HostDevice) error
}

Directories

Path Synopsis
Package legacy provides support for using GPU & vGPU devices through a specific (external) device plugin: https://github.com/NVIDIA/kubevirt-gpu-device-plugin The DP passes GPU &vGPU devices by setting env variables in the virt-launcher pod.
Package legacy provides support for using GPU & vGPU devices through a specific (external) device plugin: https://github.com/NVIDIA/kubevirt-gpu-device-plugin The DP passes GPU &vGPU devices by setting env variables in the virt-launcher pod.

Jump to

Keyboard shortcuts

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