generic

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Vfio = iota
	VirtioVdpa
	VhostVdpa
)

driver id

Variables

View Source
var PluginName = "generic"

Functions

func NewGenericPlugin added in v1.2.0

func NewGenericPlugin(helpers helper.HostHelpersInterface, options ...Option) (plugin.VendorPlugin, error)

Initialize our plugin and set up initial values

Types

type DriverState added in v1.3.0

type DriverState struct {
	DriverName     string
	DeviceType     string
	VdpaType       string
	NeedDriverFunc needDriver
	DriverLoaded   bool
}

type DriverStateMapType added in v1.3.0

type DriverStateMapType map[uint]*DriverState

type GenericPlugin

type GenericPlugin struct {
	PluginName        string
	SpecVersion       string
	DesireState       *sriovnetworkv1.SriovNetworkNodeState
	DriverStateMap    DriverStateMapType
	DesiredKernelArgs map[string]bool
	// contains filtered or unexported fields
}

func (*GenericPlugin) Apply

func (p *GenericPlugin) Apply() error

Apply config change

func (*GenericPlugin) CheckStatusChanges added in v1.3.0

func (p *GenericPlugin) CheckStatusChanges(current *sriovnetworkv1.SriovNetworkNodeState) (bool, error)

CheckStatusChanges verify whether SriovNetworkNodeState CR status present changes on configured VFs.

func (*GenericPlugin) Name

func (p *GenericPlugin) Name() string

Name returns the name of the plugin

func (*GenericPlugin) OnNodeStateChange

func (p *GenericPlugin) OnNodeStateChange(new *sriovnetworkv1.SriovNetworkNodeState) (needDrain bool, needReboot bool, err error)

OnNodeStateChange Invoked when SriovNetworkNodeState CR is created or updated, return if need drain and/or reboot node

func (*GenericPlugin) Spec

func (p *GenericPlugin) Spec() string

Spec returns the version of the spec expected by the plugin

type Option added in v1.3.0

type Option = func(c *genericPluginOptions)

func WithSkipBridgeConfiguration added in v1.4.0

func WithSkipBridgeConfiguration() Option

WithSkipBridgeConfiguration configures generic_plugin to skip configuration of the managed bridges

func WithSkipVFConfiguration added in v1.3.0

func WithSkipVFConfiguration() Option

WithSkipVFConfiguration configures generic plugin to skip configuration of the VFs. In this case PFs will be configured and VFs are created only, VF configuration phase is skipped. VFs on the PF (if the PF is not ExternallyManaged) will have no driver after the plugin execution completes.

Jump to

Keyboard shortcuts

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