Add mode option to nvcdi API

Signed-off-by: Evan Lezar <elezar@nvidia.com>
This commit is contained in:
Evan Lezar 2023-02-16 15:52:39 +01:00
parent 7eb435eb73
commit 5103adab89
2 changed files with 8 additions and 0 deletions

View File

@ -28,6 +28,7 @@ import (
type nvcdilib struct { type nvcdilib struct {
logger *logrus.Logger logger *logrus.Logger
nvmllib nvml.Interface nvmllib nvml.Interface
mode string
devicelib device.Interface devicelib device.Interface
deviceNamer DeviceNamer deviceNamer DeviceNamer
driverRoot string driverRoot string

View File

@ -66,3 +66,10 @@ func WithNvmlLib(nvmllib nvml.Interface) Option {
l.nvmllib = nvmllib l.nvmllib = nvmllib
} }
} }
// WithMode sets the discovery mode for the library
func WithMode(mode string) Option {
return func(l *nvcdilib) {
l.mode = mode
}
}