Documentation ¶
Index ¶
- Constants
- func IsChanClosed(ch <-chan struct{}) bool
- func SocketPath(deviceName string) string
- type ControlledDevice
- type DeviceController
- type DeviceHandler
- type DeviceUtilsHandler
- func (h *DeviceUtilsHandler) GetDeviceDriver(basepath string, pciAddress string) (string, error)
- func (h *DeviceUtilsHandler) GetDeviceIOMMUGroup(basepath string, pciAddress string) (string, error)
- func (h *DeviceUtilsHandler) GetDeviceNumaNode(basepath string, pciAddress string) (numaNode int)
- func (h *DeviceUtilsHandler) GetDevicePCIID(basepath string, pciAddress string) (string, error)
- func (h *DeviceUtilsHandler) GetMdevParentPCIAddr(mdevUUID string) (string, error)
- type GenericDevice
- type GenericDevicePlugin
- func (dpi *GenericDevicePlugin) Allocate(ctx context.Context, r *pluginapi.AllocateRequest) (*pluginapi.AllocateResponse, error)
- func (dpi *GenericDevicePlugin) GetDeviceName() string
- func (dpi *GenericDevicePlugin) GetDevicePath() string
- func (dpi *GenericDevicePlugin) GetDevicePluginOptions(ctx context.Context, e *pluginapi.Empty) (*pluginapi.DevicePluginOptions, error)
- func (dpi *GenericDevicePlugin) GetInitialized() bool
- func (dpi *GenericDevicePlugin) ListAndWatch(e *pluginapi.Empty, s pluginapi.DevicePlugin_ListAndWatchServer) error
- func (dpi *GenericDevicePlugin) PreStartContainer(ctx context.Context, in *pluginapi.PreStartContainerRequest) (*pluginapi.PreStartContainerResponse, error)
- func (dpi *GenericDevicePlugin) Register() error
- func (dpi *GenericDevicePlugin) Start(stop chan struct{}) (err error)
- func (dpi *GenericDevicePlugin) Stop() error
- type MDEV
- type MediatedDevicePlugin
- func (dpi *MediatedDevicePlugin) Allocate(ctx context.Context, r *pluginapi.AllocateRequest) (*pluginapi.AllocateResponse, error)
- func (dpi *MediatedDevicePlugin) GetDeviceName() string
- func (dpi *MediatedDevicePlugin) GetDevicePath() string
- func (dpi *MediatedDevicePlugin) GetDevicePluginOptions(ctx context.Context, e *pluginapi.Empty) (*pluginapi.DevicePluginOptions, error)
- func (dpi *MediatedDevicePlugin) GetInitialized() bool
- func (dpi *MediatedDevicePlugin) ListAndWatch(e *pluginapi.Empty, s pluginapi.DevicePlugin_ListAndWatchServer) error
- func (dpi *MediatedDevicePlugin) PreStartContainer(ctx context.Context, in *pluginapi.PreStartContainerRequest) (*pluginapi.PreStartContainerResponse, error)
- func (dpi *MediatedDevicePlugin) Register() error
- func (dpi *MediatedDevicePlugin) Start(stop chan struct{}) (err error)
- func (dpi *MediatedDevicePlugin) Stop() error
- type MockDeviceHandler
- func (_m *MockDeviceHandler) EXPECT() *_MockDeviceHandlerRecorder
- func (_m *MockDeviceHandler) GetDeviceDriver(basepath string, pciAddress string) (string, error)
- func (_m *MockDeviceHandler) GetDeviceIOMMUGroup(basepath string, pciAddress string) (string, error)
- func (_m *MockDeviceHandler) GetDeviceNumaNode(basepath string, pciAddress string) int
- func (_m *MockDeviceHandler) GetDevicePCIID(basepath string, pciAddress string) (string, error)
- func (_m *MockDeviceHandler) GetMdevParentPCIAddr(mdevUUID string) (string, error)
- type PCIDevice
- type PCIDevicePlugin
- func (dpi *PCIDevicePlugin) Allocate(ctx context.Context, r *pluginapi.AllocateRequest) (*pluginapi.AllocateResponse, error)
- func (dpi *PCIDevicePlugin) GetDeviceName() string
- func (dpi *PCIDevicePlugin) GetDevicePath() string
- func (dpi *PCIDevicePlugin) GetDevicePluginOptions(ctx context.Context, e *pluginapi.Empty) (*pluginapi.DevicePluginOptions, error)
- func (dpi *PCIDevicePlugin) GetInitialized() bool
- func (dpi *PCIDevicePlugin) ListAndWatch(e *pluginapi.Empty, s pluginapi.DevicePlugin_ListAndWatchServer) error
- func (dpi *PCIDevicePlugin) PreStartContainer(ctx context.Context, in *pluginapi.PreStartContainerRequest) (*pluginapi.PreStartContainerResponse, error)
- func (dpi *PCIDevicePlugin) Register() error
- func (dpi *PCIDevicePlugin) Start(stop chan struct{}) (err error)
- func (dpi *PCIDevicePlugin) Stop() error
Constants ¶
View Source
const (
DeviceNamespace = "devices.kubevirt.io"
)
View Source
const (
MDEV_RESOURCE_PREFIX = "MDEV_PCI_RESOURCE"
)
View Source
const (
PCI_RESOURCE_PREFIX = "PCI_RESOURCE"
)
Variables ¶
This section is empty.
Functions ¶
func IsChanClosed ¶ added in v0.36.0
func IsChanClosed(ch <-chan struct{}) bool
func SocketPath ¶ added in v0.16.0
Types ¶
type ControlledDevice ¶ added in v0.36.0
type ControlledDevice struct {
// contains filtered or unexported fields
}
type DeviceController ¶
type DeviceController struct {
// contains filtered or unexported fields
}
func NewDeviceController ¶
func NewDeviceController(host string, maxDevices int, clusterConfig *virtconfig.ClusterConfig) *DeviceController
func (*DeviceController) Initialized ¶ added in v0.33.0
func (c *DeviceController) Initialized() bool
func (*DeviceController) Run ¶
func (c *DeviceController) Run(stop chan struct{}) error
type DeviceHandler ¶ added in v0.36.0
type DeviceHandler interface { GetDeviceIOMMUGroup(basepath string, pciAddress string) (string, error) GetDeviceDriver(basepath string, pciAddress string) (string, error) GetDeviceNumaNode(basepath string, pciAddress string) (numaNode int) GetDevicePCIID(basepath string, pciAddress string) (string, error) GetMdevParentPCIAddr(mdevUUID string) (string, error) }
var Handler DeviceHandler
type DeviceUtilsHandler ¶ added in v0.36.0
type DeviceUtilsHandler struct{}
func (*DeviceUtilsHandler) GetDeviceDriver ¶ added in v0.36.0
func (h *DeviceUtilsHandler) GetDeviceDriver(basepath string, pciAddress string) (string, error)
gets device driver
func (*DeviceUtilsHandler) GetDeviceIOMMUGroup ¶ added in v0.36.0
func (h *DeviceUtilsHandler) GetDeviceIOMMUGroup(basepath string, pciAddress string) (string, error)
getDeviceIOMMUGroup gets devices iommu_group e.g. /sys/bus/pci/devices/0000\:65\:00.0/iommu_group -> ../../../../../kernel/iommu_groups/45
func (*DeviceUtilsHandler) GetDeviceNumaNode ¶ added in v0.36.0
func (h *DeviceUtilsHandler) GetDeviceNumaNode(basepath string, pciAddress string) (numaNode int)
func (*DeviceUtilsHandler) GetDevicePCIID ¶ added in v0.36.0
func (h *DeviceUtilsHandler) GetDevicePCIID(basepath string, pciAddress string) (string, error)
func (*DeviceUtilsHandler) GetMdevParentPCIAddr ¶ added in v0.36.0
func (h *DeviceUtilsHandler) GetMdevParentPCIAddr(mdevUUID string) (string, error)
/sys/class/mdev_bus/0000:00:03.0/53764d0e-85a0-42b4-af5c-2046b460b1dc
type GenericDevice ¶ added in v0.8.0
type GenericDevicePlugin ¶
type GenericDevicePlugin struct {
// contains filtered or unexported fields
}
func NewGenericDevicePlugin ¶
func NewGenericDevicePlugin(deviceName string, devicePath string, maxDevices int, preOpen bool) *GenericDevicePlugin
func (*GenericDevicePlugin) Allocate ¶
func (dpi *GenericDevicePlugin) Allocate(ctx context.Context, r *pluginapi.AllocateRequest) (*pluginapi.AllocateResponse, error)
func (*GenericDevicePlugin) GetDeviceName ¶ added in v0.8.0
func (dpi *GenericDevicePlugin) GetDeviceName() string
func (*GenericDevicePlugin) GetDevicePath ¶ added in v0.8.0
func (dpi *GenericDevicePlugin) GetDevicePath() string
func (*GenericDevicePlugin) GetDevicePluginOptions ¶
func (dpi *GenericDevicePlugin) GetDevicePluginOptions(ctx context.Context, e *pluginapi.Empty) (*pluginapi.DevicePluginOptions, error)
func (*GenericDevicePlugin) GetInitialized ¶ added in v0.33.0
func (dpi *GenericDevicePlugin) GetInitialized() bool
func (*GenericDevicePlugin) ListAndWatch ¶
func (dpi *GenericDevicePlugin) ListAndWatch(e *pluginapi.Empty, s pluginapi.DevicePlugin_ListAndWatchServer) error
func (*GenericDevicePlugin) PreStartContainer ¶
func (dpi *GenericDevicePlugin) PreStartContainer(ctx context.Context, in *pluginapi.PreStartContainerRequest) (*pluginapi.PreStartContainerResponse, error)
func (*GenericDevicePlugin) Register ¶
func (dpi *GenericDevicePlugin) Register() error
Register registers the device plugin for the given resourceName with Kubelet.
func (*GenericDevicePlugin) Start ¶
func (dpi *GenericDevicePlugin) Start(stop chan struct{}) (err error)
Start starts the device plugin
func (*GenericDevicePlugin) Stop ¶
func (dpi *GenericDevicePlugin) Stop() error
Stop stops the gRPC server
type MDEV ¶ added in v0.36.0
type MDEV struct { UUID string // contains filtered or unexported fields }
type MediatedDevicePlugin ¶ added in v0.36.0
type MediatedDevicePlugin struct {
// contains filtered or unexported fields
}
func NewMediatedDevicePlugin ¶ added in v0.36.0
func NewMediatedDevicePlugin(mdevs []*MDEV, resourceName string) *MediatedDevicePlugin
func (*MediatedDevicePlugin) Allocate ¶ added in v0.36.0
func (dpi *MediatedDevicePlugin) Allocate(ctx context.Context, r *pluginapi.AllocateRequest) (*pluginapi.AllocateResponse, error)
func (*MediatedDevicePlugin) GetDeviceName ¶ added in v0.36.0
func (dpi *MediatedDevicePlugin) GetDeviceName() string
func (*MediatedDevicePlugin) GetDevicePath ¶ added in v0.36.0
func (dpi *MediatedDevicePlugin) GetDevicePath() string
func (*MediatedDevicePlugin) GetDevicePluginOptions ¶ added in v0.36.0
func (dpi *MediatedDevicePlugin) GetDevicePluginOptions(ctx context.Context, e *pluginapi.Empty) (*pluginapi.DevicePluginOptions, error)
func (*MediatedDevicePlugin) GetInitialized ¶ added in v0.36.0
func (dpi *MediatedDevicePlugin) GetInitialized() bool
func (*MediatedDevicePlugin) ListAndWatch ¶ added in v0.36.0
func (dpi *MediatedDevicePlugin) ListAndWatch(e *pluginapi.Empty, s pluginapi.DevicePlugin_ListAndWatchServer) error
func (*MediatedDevicePlugin) PreStartContainer ¶ added in v0.36.0
func (dpi *MediatedDevicePlugin) PreStartContainer(ctx context.Context, in *pluginapi.PreStartContainerRequest) (*pluginapi.PreStartContainerResponse, error)
func (*MediatedDevicePlugin) Register ¶ added in v0.36.0
func (dpi *MediatedDevicePlugin) Register() error
Register registers the device plugin for the given resourceName with Kubelet.
func (*MediatedDevicePlugin) Start ¶ added in v0.36.0
func (dpi *MediatedDevicePlugin) Start(stop chan struct{}) (err error)
Start starts the device plugin
func (*MediatedDevicePlugin) Stop ¶ added in v0.36.0
func (dpi *MediatedDevicePlugin) Stop() error
Stop stops the gRPC server
type MockDeviceHandler ¶ added in v0.36.0
type MockDeviceHandler struct {
// contains filtered or unexported fields
}
Mock of DeviceHandler interface
func NewMockDeviceHandler ¶ added in v0.36.0
func NewMockDeviceHandler(ctrl *gomock.Controller) *MockDeviceHandler
func (*MockDeviceHandler) EXPECT ¶ added in v0.36.0
func (_m *MockDeviceHandler) EXPECT() *_MockDeviceHandlerRecorder
func (*MockDeviceHandler) GetDeviceDriver ¶ added in v0.36.0
func (_m *MockDeviceHandler) GetDeviceDriver(basepath string, pciAddress string) (string, error)
func (*MockDeviceHandler) GetDeviceIOMMUGroup ¶ added in v0.36.0
func (_m *MockDeviceHandler) GetDeviceIOMMUGroup(basepath string, pciAddress string) (string, error)
func (*MockDeviceHandler) GetDeviceNumaNode ¶ added in v0.36.0
func (_m *MockDeviceHandler) GetDeviceNumaNode(basepath string, pciAddress string) int
func (*MockDeviceHandler) GetDevicePCIID ¶ added in v0.36.0
func (_m *MockDeviceHandler) GetDevicePCIID(basepath string, pciAddress string) (string, error)
func (*MockDeviceHandler) GetMdevParentPCIAddr ¶ added in v0.36.0
func (_m *MockDeviceHandler) GetMdevParentPCIAddr(mdevUUID string) (string, error)
type PCIDevice ¶ added in v0.36.0
type PCIDevice struct {
// contains filtered or unexported fields
}
type PCIDevicePlugin ¶ added in v0.36.0
type PCIDevicePlugin struct {
// contains filtered or unexported fields
}
func NewPCIDevicePlugin ¶ added in v0.36.0
func NewPCIDevicePlugin(pciDevices []*PCIDevice, resourceName string) *PCIDevicePlugin
func (*PCIDevicePlugin) Allocate ¶ added in v0.36.0
func (dpi *PCIDevicePlugin) Allocate(ctx context.Context, r *pluginapi.AllocateRequest) (*pluginapi.AllocateResponse, error)
func (*PCIDevicePlugin) GetDeviceName ¶ added in v0.36.0
func (dpi *PCIDevicePlugin) GetDeviceName() string
func (*PCIDevicePlugin) GetDevicePath ¶ added in v0.36.0
func (dpi *PCIDevicePlugin) GetDevicePath() string
func (*PCIDevicePlugin) GetDevicePluginOptions ¶ added in v0.36.0
func (dpi *PCIDevicePlugin) GetDevicePluginOptions(ctx context.Context, e *pluginapi.Empty) (*pluginapi.DevicePluginOptions, error)
func (*PCIDevicePlugin) GetInitialized ¶ added in v0.36.0
func (dpi *PCIDevicePlugin) GetInitialized() bool
func (*PCIDevicePlugin) ListAndWatch ¶ added in v0.36.0
func (dpi *PCIDevicePlugin) ListAndWatch(e *pluginapi.Empty, s pluginapi.DevicePlugin_ListAndWatchServer) error
func (*PCIDevicePlugin) PreStartContainer ¶ added in v0.36.0
func (dpi *PCIDevicePlugin) PreStartContainer(ctx context.Context, in *pluginapi.PreStartContainerRequest) (*pluginapi.PreStartContainerResponse, error)
func (*PCIDevicePlugin) Register ¶ added in v0.36.0
func (dpi *PCIDevicePlugin) Register() error
Register registers the device plugin for the given resourceName with Kubelet.
func (*PCIDevicePlugin) Start ¶ added in v0.36.0
func (dpi *PCIDevicePlugin) Start(stop chan struct{}) (err error)
Start starts the device plugin
func (*PCIDevicePlugin) Stop ¶ added in v0.36.0
func (dpi *PCIDevicePlugin) Stop() error
Stop stops the gRPC server
Source Files ¶
Click to show internal directories.
Click to hide internal directories.