Documentation ¶
Index ¶
- Constants
- func AttachHostDevices(dom deviceAttacher, hostDevices []api.HostDevice) error
- func CreateMDEVHostDevices(hostDevicesData []HostDeviceMetaData, mdevAddrPool AddressPooler, ...) ([]api.HostDevice, error)
- func CreatePCIHostDevices(hostDevicesData []HostDeviceMetaData, pciAddrPool AddressPooler) ([]api.HostDevice, error)
- func DifferenceHostDevicesByAlias(desiredHostDevices, actualHostDevices []api.HostDevice) []api.HostDevice
- func FilterHostDevicesByAlias(hostDevices []api.HostDevice, prefix string) []api.HostDevice
- func SafelyDetachHostDevices(hostDevices []api.HostDevice, eventDetach EventRegistrar, dom DeviceDetacher, ...) error
- type AddressPool
- type AddressPooler
- type BestEffortAddressPool
- type DeviceDetacher
- type EventRegistrar
- type HostDeviceMetaData
Constants ¶
const (
MaxConcurrentHotPlugDevicesEvents = 32
)
Variables ¶
This section is empty.
Functions ¶
func AttachHostDevices ¶ added in v0.49.0
func AttachHostDevices(dom deviceAttacher, hostDevices []api.HostDevice) error
func CreateMDEVHostDevices ¶
func CreateMDEVHostDevices(hostDevicesData []HostDeviceMetaData, mdevAddrPool AddressPooler, enableDefaultDisplay bool) ([]api.HostDevice, error)
func CreatePCIHostDevices ¶
func CreatePCIHostDevices(hostDevicesData []HostDeviceMetaData, pciAddrPool AddressPooler) ([]api.HostDevice, error)
func DifferenceHostDevicesByAlias ¶ added in v0.49.0
func DifferenceHostDevicesByAlias(desiredHostDevices, actualHostDevices []api.HostDevice) []api.HostDevice
DifferenceHostDevicesByAlias given two slices of host-devices, according to Alias.Name, it returns a slice with host-devices that exists on the first slice and not exists on the second.
func FilterHostDevicesByAlias ¶ added in v0.49.0
func FilterHostDevicesByAlias(hostDevices []api.HostDevice, prefix string) []api.HostDevice
func SafelyDetachHostDevices ¶ added in v0.49.0
func SafelyDetachHostDevices(hostDevices []api.HostDevice, eventDetach EventRegistrar, dom DeviceDetacher, timeout time.Duration) 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 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).
type DeviceDetacher ¶ added in v0.49.0
type DeviceDetacher interface {
DetachDeviceFlags(xml string, flags libvirt.DomainDeviceModifyFlags) error
}
type EventRegistrar ¶ added in v0.49.0
type HostDeviceMetaData ¶
type HostDeviceMetaData struct { AliasPrefix string Name string ResourceName string VirtualGPUOptions *v1.VGPUOptions // 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 }