Specify library search paths for CSV CDI spec generation

Signed-off-by: Evan Lezar <elezar@nvidia.com>
This commit is contained in:
Evan Lezar
2023-07-18 12:02:37 +02:00
parent 03a4e2f8a9
commit 8553fce68a
6 changed files with 45 additions and 15 deletions

View File

@@ -51,7 +51,8 @@ type options struct {
class string
csv struct {
files cli.StringSlice
files cli.StringSlice
librarySearchPaths cli.StringSlice
}
}
@@ -134,6 +135,11 @@ func (m command) build() *cli.Command {
Value: cli.NewStringSlice(csv.DefaultFileList()...),
Destination: &opts.csv.files,
},
&cli.StringSliceFlag{
Name: "csv.library-search-path",
Usage: "Specify the path to search for libraries when discovering the entities that should be included in the CDI specification. This currently only affects CDI mode",
Destination: &opts.csv.librarySearchPaths,
},
}
return &c
@@ -227,6 +233,7 @@ func (m command) generateSpec(opts *options) (spec.Interface, error) {
nvcdi.WithDeviceNamer(deviceNamer),
nvcdi.WithMode(string(opts.mode)),
nvcdi.WithCSVFiles(opts.csv.files.Value()),
nvcdi.WithLibrarySearchPaths(opts.csv.librarySearchPaths.Value()),
)
if err != nil {
return nil, fmt.Errorf("failed to create CDI library: %v", err)