Allow options to be passed when creating an instance of the nvpci interface

Signed-off-by: Christopher Desiniotis <cdesiniotis@nvidia.com>
This commit is contained in:
Christopher Desiniotis
2023-06-09 17:27:31 -07:00
parent 76018d282e
commit 066d8f30bc
3 changed files with 30 additions and 8 deletions

View File

@@ -380,5 +380,7 @@ func (p *ParentDevice) GetAvailableMDEVInstances(mdevType string) (int, error) {
func newNvidiaPCIDeviceFromPath(devicePath string) (*nvpci.NvidiaPCIDevice, error) {
root := filepath.Dir(devicePath)
address := filepath.Base(devicePath)
return nvpci.NewFrom(root).GetGPUByPciBusID(address)
return nvpci.New(
nvpci.WithPCIDevicesRoot(root),
).GetGPUByPciBusID(address)
}