# Name

VixDiskLib_ReadMetadata

# Description

    VixError
    VixDiskLib_ReadMetadata(VixDiskLibHandle diskHandle,
                            const char *key,
                            char *buf,
                            size_t bufLen,
                            size_t *requiredLen);

This function retrieves the value of the given key from the disk metadata.

# Parameters

diskHandle
  Handle to an open virtual disk.
key
  Name of the key.
buf
  Buffer to fill in the value.
bufLen
  Length of the buffer for the value.
requiredLen
  Length of the key's value in bytes.

# Return Value

VIX_OK if the function succeeded, otherwise an appropriate VIX error code.

# Remarks

- Each virtual disk has a small amount of space to save arbitrary <key,value> pairs.
- Both key and value can be only ANSI strings.
- If bufLen is less than the space required, VixDiskLib_ReadMetadata() will not modify the keys buffer and will return VIX_E_BUFFER_TOOSMALL.

# Example

       vixError = VixDiskLib_ReadMetadata(disk.Handle(),
                                          appGlobals.metaKey,
                                          &val[0],
                                          requiredLen,
                                          NULL);

Copyright (C) 2007-2018 VMware, Inc. All rights reserved.