package devices
import "github.com/Microsoft/hcsshim/internal/devices"
Index ¶
- func AddDevice(ctx context.Context, vm *uvm.UtilityVM, idType, deviceID string, index uint16, deviceUtilPath string) (vpci *uvm.VPCIDevice, locationPaths []string, err error)
- func InstallKernelDriver(ctx context.Context, vm *uvm.UtilityVM, driver string) (closer resources.ResourceCloser, err error)
Functions ¶
func AddDevice ¶
func AddDevice(ctx context.Context, vm *uvm.UtilityVM, idType, deviceID string, index uint16, deviceUtilPath string) (vpci *uvm.VPCIDevice, locationPaths []string, err error)
AddDevice is the api exposed to hcsoci to handle assigning a device on a UVM
`idType` refers to the specified device's type, supported types here are `VPCIDeviceIDType` and `VPCIDeviceIDTypeLegacy`.
`deviceID` refers to the specified device's identifier. This must refer to a device instance id for hyper-v isolated device assignment.
`deviceUtilPath` refers to the path in the UVM of the device-util tool used for finding the given device's location path(s).
Returns the allocated vpci device in `vpci` to be tracked for release by the caller. On failure in this function, `vpci` is released and nil is returned for that value.
Returns a slice of strings representing the resulting location path(s) for the specified device.
func InstallKernelDriver ¶
func InstallKernelDriver(ctx context.Context, vm *uvm.UtilityVM, driver string) (closer resources.ResourceCloser, err error)
InstallKernelDriver mounts a specified kernel driver, then installs it in the UVM.
`driver` is a directory path on the host that contains driver files for standard installation. For windows this means files for pnp installation (.inf, .cat, .sys, .cert files). For linux this means a vhd file that contains the drivers under /lib/modules/`uname -r` for use with depmod and modprobe.
Returns a ResourceCloser for the added mount. On failure, the mounted share will be released, the returned ResourceCloser will be nil, and an error will be returned.
Source Files ¶
assigned_devices.go doc.go drivers.go pnp.go
- Version
- v0.10.0-rc.0
- Published
- Jul 18, 2022
- Platform
- windows/amd64
- Imports
- 14 packages
- Last checked
- 10 minutes ago –
Tools for package owners.