deviceattribute

package
v0.34.1 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2025 License: Apache-2.0 Imports: 6 Imported by: 3

Documentation

Index

Constants

View Source
const (
	// StandardDeviceAttributePrefix is the prefix used for standard device attributes.
	StandardDeviceAttributePrefix = "resource.kubernetes.io/"

	// StandardDeviceAttributePCIeRoot is a standard device attribute name
	// which describe PCIe Root Complex of the PCIe device.
	// The value is a string value in the format `pci<domain>:<bus>`,
	// referring to a PCIe (Peripheral Component Interconnect Express) Root Complex.
	// This attribute can be used to identify devices that share the same PCIe Root Complex.
	StandardDeviceAttributePCIeRoot resourceapi.QualifiedName = StandardDeviceAttributePrefix + "pcieRoot"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DeviceAttribute

type DeviceAttribute struct {
	// Name is the qualified name of the device attribute.
	Name resourceapi.QualifiedName
	// Value is the value of the device attribute.
	Value resourceapi.DeviceAttribute
}

DeviceAttribute represents a device attribute name and its value

func GetPCIeRootAttributeByPCIBusID

func GetPCIeRootAttributeByPCIBusID(pciBusID string) (DeviceAttribute, error)

GetPCIeRootAttributeByPCIBusID retrieves the PCIe Root Complex for a given PCI Bus ID. in BDF (Bus-Device-Function) format, e.g., "0123:45:1e.7".

It returns a DeviceAttribute with the PCIe Root Complex information("pci<domain>:<bus>") as a string value or an error if the PCI Bus ID is invalid or the root complex cannot be determined.

ref: https://wiki.xenproject.org/wiki/Bus:Device.Function_(BDF)_Notation

Jump to

Keyboard shortcuts

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