Documentation ¶
Overview ¶
Package mdevfs facilitates communication with mediated devices through the local sysfs file system.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type MediatedDevice ¶
type MediatedDevice struct {
// contains filtered or unexported fields
}
MediatedDevice provides access to a mediated device through the local file system.
func NewMediatedDevice ¶
func NewMediatedDevice(id machina.DeviceID) MediatedDevice
NewMediatedDevice prepares access to a mediated device through the local file system. It expects the device to be present in /sys/bus/mdev/devices.
func (MediatedDevice) Exists ¶
func (mdev MediatedDevice) Exists() (bool, error)
Exists returns true if the mediated device already exists.
func (MediatedDevice) Path ¶
func (mdev MediatedDevice) Path() string
Path returns the sysfs path for the mediated device.
func (MediatedDevice) Remove ¶
func (mdev MediatedDevice) Remove() error
Remove attempts to remove the mediated device from the system.
type PhysicalDevice ¶
type PhysicalDevice struct {
// contains filtered or unexported fields
}
PhysicalDevice provides access to a physical PCI device through the local file system.
func NewPhysicalDevice ¶
func NewPhysicalDevice(address machina.DeviceAddress) PhysicalDevice
NewPhysicalDevice returns a physical device accessor that will access a PCI device with the given address through the local file system. It expects the device to be present in /sys/bus/pci/devices.
func (PhysicalDevice) Address ¶
func (pdev PhysicalDevice) Address() machina.DeviceAddress
Address returns the PCI address for the physical device.
func (PhysicalDevice) Exists ¶
func (pdev PhysicalDevice) Exists() (bool, error)
Exists returns true if the sysfs path for the device exists.
func (PhysicalDevice) Path ¶
func (pdev PhysicalDevice) Path() string
Path returns the sysfs path for the physical device.
func (PhysicalDevice) Types ¶
func (pdev PhysicalDevice) Types() (types TypeList, err error)
Types returns the set of mediated device types that are supported by the physical device.
type Type ¶
type Type struct {
// contains filtered or unexported fields
}
Type describes a supported type offered by a mediated device on the local system.
func (Type) AvailableInstances ¶
AvailableInstances returns the number of instances currently available for the supported type.
The value is queried at the of the function call, and is not cached.
func (Type) Create ¶
Create requests the creation of a mediated device of type t with the given device ID.
func (Type) Description ¶
Description returns the description of the supported type, which is optional.