Refactor Gpumon.load_config

Split load_config into smaller functions for testing purposes.

Signed-off-by: John Else <john.else@citrix.com>
Move config parsing code to config.ml

Signed-off-by: John Else <john.else@citrix.com>
Add type Config.config

Signed-off-by: John Else <john.else@citrix.com>
Don't reverse the parsed config

The List.fold_left creates a dictionary with keys in the reverse order
compared to how they are presented in the config file. Reversing the
dictionary again leads to the order being preserved.

Signed-off-by: John Else <john.else@citrix.com>
Add config.mli

Signed-off-by: John Else <john.else@citrix.com>
Add Config.to_string

Signed-off-by: John Else <john.else@citrix.com>
Add some tests of the config file reading code

Signed-off-by: John Else <john.else@citrix.com>
Refactor Config.of_rpc out from Config.of_string

Signed-off-by: John Else <john.else@citrix.com>
Convert Config.config into a proper type

Signed-off-by: John Else <john.else@citrix.com>
Refactor Config.of_v1_format out of Config.of_rpc

Signed-off-by: John Else <john.else@citrix.com>
Add optional subsystem ID requirement to device config

Signed-off-by: John Else <john.else@citrix.com>
Use monadic error handling throughout config.ml

Signed-off-by: John Else <john.else@citrix.com>
Add v2 config format parsing

Signed-off-by: John Else <john.else@citrix.com>
Add tests of the v2 config format parsing

Signed-off-by: John Else <john.else@citrix.com>
CP-8359: Add check for subsystem device IDs

If the config file specifies a required subsystem device ID for a device
type, take this into account when constructing the list of metrics
required for a device.

Signed-off-by: John Else <john.else@citrix.com>
nvml: Load symbol nvmlDeviceGetPciInfo_v2

nvmlDeviceGetPciInfo is aliased to nvmlDeviceGetPciInfo_v2 in nvml.h,
however because we are here loading the symbol dynamically by its name
the alias does not take effect. To work around this, we load the symbol
nvmlDeviceGetPciInfo_v2 explicitly.

Signed-off-by John Else <john.else@citrix.com>
Merge pull request #7 from johnelse/cp-8359

CP-8359: Add check for subsystem device IDs