pci

package
v0.0.21 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func New

func New(c HTTPClient) *Client

func (*Client) Find

func (c *Client) Find(ctx context.Context, req FindRequest) ([]FindResponse, error)

Find Index of available pci methods

func (*Client) Index

func (c *Client) Index(ctx context.Context, req IndexRequest) ([]IndexResponse, error)

Index List local PCI devices.

func (*Client) Mdevscan added in v0.0.15

func (c *Client) Mdevscan(ctx context.Context, req MdevscanRequest) ([]MdevscanResponse, error)

Mdevscan List mediated device types for given PCI device.

type FindRequest

type FindRequest struct {
	Node  string `url:"node" json:"node"` // The cluster node name.
	Pciid string `url:"pciid" json:"pciid"`
}

type FindResponse

type FindResponse struct {
	Method string `url:"method" json:"method"`
}

type HTTPClient

type HTTPClient interface {
	Do(context.Context, string, string, interface{}, interface{}) error
}

type IndexRequest

type IndexRequest struct {
	Node string `url:"node" json:"node"` // The cluster node name.

	// The following parameters are optional
	PciClassBlacklist *string       `url:"pci-class-blacklist,omitempty" json:"pci-class-blacklist,omitempty"` // A list of blacklisted PCI classes, which will not be returned. Following are filtered by default: Memory Controller (05), Bridge (06) and Processor (0b).
	Verbose           *util.PVEBool `url:"verbose,omitempty" json:"verbose,omitempty"`                         // If disabled, does only print the PCI IDs. Otherwise, additional information like vendor and device will be returned.
}

type IndexResponse

type IndexResponse struct {
	Class      string `url:"class" json:"class"`           // The PCI Class of the device.
	Device     string `url:"device" json:"device"`         // The Device ID.
	Id         string `url:"id" json:"id"`                 // The PCI ID.
	Iommugroup int    `url:"iommugroup" json:"iommugroup"` // The IOMMU group in which the device is in. If no IOMMU group is detected, it is set to -1.
	Vendor     string `url:"vendor" json:"vendor"`         // The Vendor ID.

	// The following parameters are optional
	DeviceName          *string       `url:"device_name,omitempty" json:"device_name,omitempty"`
	Mdev                *util.PVEBool `url:"mdev,omitempty" json:"mdev,omitempty"`                         // If set, marks that the device is capable of creating mediated devices.
	SubsystemDevice     *string       `url:"subsystem_device,omitempty" json:"subsystem_device,omitempty"` // The Subsystem Device ID.
	SubsystemDeviceName *string       `url:"subsystem_device_name,omitempty" json:"subsystem_device_name,omitempty"`
	SubsystemVendor     *string       `url:"subsystem_vendor,omitempty" json:"subsystem_vendor,omitempty"` // The Subsystem Vendor ID.
	SubsystemVendorName *string       `url:"subsystem_vendor_name,omitempty" json:"subsystem_vendor_name,omitempty"`
	VendorName          *string       `url:"vendor_name,omitempty" json:"vendor_name,omitempty"`
}

type MdevscanRequest added in v0.0.15

type MdevscanRequest struct {
	Node  string `url:"node" json:"node"`   // The cluster node name.
	Pciid string `url:"pciid" json:"pciid"` // The PCI ID to list the mdev types for.

}

type MdevscanResponse added in v0.0.15

type MdevscanResponse struct {
	Available   int    `url:"available" json:"available"` // The number of still available instances of this type.
	Description string `url:"description" json:"description"`
	Type        string `url:"type" json:"type"` // The name of the mdev type.

}

Jump to

Keyboard shortcuts

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