diff options
| author | Joey Jiao <joeyjiaojg@qq.com> | 2023-07-02 12:14:03 +0800 |
|---|---|---|
| committer | Aleksandr Nogikh <nogikh@google.com> | 2023-07-04 16:43:58 +0000 |
| commit | 9a97070da62577e730aaaae4cf657900abb16957 (patch) | |
| tree | bc3b5d3eaddd3d9036c1302e59cbb64b6c52cd58 /pkg/host/machine_info.go | |
| parent | db33bc12e4f969af9479eb1c55d6a5ed2050b9b5 (diff) | |
pkg/host: export ParseModulesText
Change-Id: I3119aed5cfe223e24cfc56b27612adaf2a638a99
Diffstat (limited to 'pkg/host/machine_info.go')
| -rw-r--r-- | pkg/host/machine_info.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/pkg/host/machine_info.go b/pkg/host/machine_info.go index 3c04becab..779356d4a 100644 --- a/pkg/host/machine_info.go +++ b/pkg/host/machine_info.go @@ -45,9 +45,17 @@ func CollectGlobsInfo(globs map[string]bool) (map[string][]string, error) { return machineGlobsInfo(globs) } +func ParseModulesText(modulesText []byte) ([]KernelModule, error) { + if machineParseModules == nil { + return nil, nil + } + return machineParseModules(modulesText) +} + var machineInfoFuncs []machineInfoFunc var machineModulesInfo func() ([]KernelModule, error) var machineGlobsInfo func(map[string]bool) (map[string][]string, error) +var machineParseModules func([]byte) ([]KernelModule, error) type machineInfoFunc struct { name string |
