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 InstallDrivers(ctx context.Context, vm *uvm.UtilityVM, share string, gpuDriver bool) (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 InstallDrivers ¶
func InstallDrivers(ctx context.Context, vm *uvm.UtilityVM, share string, gpuDriver bool) (closer resources.ResourceCloser, err error)
InstallDriver mounts a share from the host into the UVM, installs any kernel drivers in the share, and configures the environment for library files and/or binaries in the share.
InstallDriver mounts a specified kernel driver, then installs it in the UVM.
`share` is a directory path on the host that contains files for standard driver 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. For GPU, this vhd may also contain library files (under /usr/lib) and binaries (under /usr/bin or /usr/sbin) to be used in conjunction with the modules.
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.11.7
- Published
- Jun 27, 2024
- Platform
- windows/amd64
- Imports
- 15 packages
- Last checked
- 17 minutes ago –
Tools for package owners.