Documentation
¶
Index ¶
Constants ¶
View Source
const ( // Timeout amount of time in ms to poll the hyperv kernel device Timeout = 1000 KvpOpRegister1 = 100 HvSOk = 0 HvKvpExchangeMaxValueSize = 2048 HvKvpExchangeMaxKeySize = 512 KvpOpSet = 1 // KvpKernelDevice s the hyperv kernel device used for communicating key-values pairs // on hyperv between the host and guest KvpKernelDevice = "/dev/vmbus/hv_kvp" // DefaultKVPPoolID is where Windows host write to for Linux VMs DefaultKVPPoolID = 0 )
Variables ¶
View Source
var ( // ErrUnableToWriteToKVP is used when we are unable to write to the kernel // device for hyperv ErrUnableToWriteToKVP = errors.New("failed to write to hv_kvp") // ErrUnableToReadFromKVP is used when we are unable to read from the kernel // device for hyperv ErrUnableToReadFromKVP = errors.New("failed to read from hv_kvp") // ErrNoKeyValuePairsFound means we were unable to find key-value pairs as passed // from the hyperv host to this guest. ErrNoKeyValuePairsFound = errors.New("unable to find kvp keys") )
Functions ¶
func GetKeyValuePairs ¶
GetKeyValuePairs reads the key value pairs from the wmi hyperv kernel device and returns them in map form. the map value is a ValuePair which contains the value string and the poolid
func GetSplitKeyValues ¶
func GetSplitKeyValues(key string, pool PoolID, kvps map[string]ValuePair) (string, map[string]ValuePair, error)
GetSplitKeyValues "filters" KVPs looking for split values using a key and pool_id. Returns the assembled split values as a key as well as a new KVP that no longer has the split keys in question
Types ¶
Click to show internal directories.
Click to hide internal directories.