Documentation
¶
Index ¶
Constants ¶
View Source
const ( // Timeout amount of time in ms to poll the hyperv kernel device Timeout = 1000 OpRegister1 = 100 HvSOk = 0 HvKvpExchangeMaxValueSize = 2048 HvKvpExchangeMaxKeySize = 512 OpSet = 1 // KernelDevice s the hyperv kernel device used for communicating key-values pairs // on hyperv between the host and guest KernelDevice = "/dev/vmbus/hv_kvp" // DefaultKVPPoolID is where Windows host write to for Linux VMs DefaultKVPPoolID = 0 DefaultKVPBaseName = ".kvp_pool_" DefaultKVPFilePath = "/var/lib/hyperv" DefaultKVPFileWritePermissions = 644 )
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") // ErrKeyNotFound means we could not find the key in information read ErrKeyNotFound = errors.New("unable to find key") )
Functions ¶
This section is empty.
Types ¶
type KeyValuePair ¶ added in v0.0.2
type KeyValuePair map[PoolID]ValuePairs
func GetKeyValuePairs ¶
func GetKeyValuePairs() (KeyValuePair, error)
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 (KeyValuePair) EncodePoolFile ¶ added in v0.0.5
func (kv KeyValuePair) EncodePoolFile(poolID PoolID) (poolFile []byte)
func (KeyValuePair) GetSplitKeyValues ¶ added in v0.0.2
func (kv KeyValuePair) GetSplitKeyValues(key string, pool PoolID) (string, KeyValuePair, 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
func (KeyValuePair) WriteToFS ¶ added in v0.0.2
func (kv KeyValuePair) WriteToFS(path string) error
type ValuePairs ¶ added in v0.0.2
type ValuePairs []ValuePair
Click to show internal directories.
Click to hide internal directories.