module documentation

Undocumented

Function DictToQemuStringNotation Convert dictionary to flat string representation
Function FlattenDict Helper method to convert nested dicts to flat string representation
Function GetCacheSettings Return cache settings suitable for use with -blockdev
Function ParseStorageUriToBlockdevParam Parse a storage uri into qemu blockdev params
Function TranslateBoolToOnOff Converts a given boolean to 'on'|'off' for use in QEMUs cmdline
Constant _BLOCKDEV_URI_REGEX_GLUSTER Undocumented
Constant _BLOCKDEV_URI_REGEX_RBD Undocumented
def DictToQemuStringNotation(data):

Convert dictionary to flat string representation

This function is used to transform a blockdev QEMU parameter set for use as command line parameters (to QEMUs -blockdev parameter)

Parameters
data:dictdata to convert
Returns
string
def FlattenDict(d, parent_key='', sep='.'):

Helper method to convert nested dicts to flat string representation

def GetCacheSettings(cache_type, dev_type):

Return cache settings suitable for use with -blockdev

Parameters
cache_typestring (one of constants.HT_VALID_CACHE_TYPES)
dev_typestring (one of constants.DISK_TEMPLATES
Returns
tuple(writeback, direct, no_flush)
def ParseStorageUriToBlockdevParam(uri):

Parse a storage uri into qemu blockdev params

Parameters
uri:stringstorage-describing URI
Returns
dict
def TranslateBoolToOnOff(value):

Converts a given boolean to 'on'|'off' for use in QEMUs cmdline

Parameters
valuebool
Returns
string'on' or 'off'
_BLOCKDEV_URI_REGEX_GLUSTER: str =

Undocumented

Value
'^gluster:\\/\\/(?P<host>[a-z0-9-.]+):(?P<port>\\d+)/(?P<volume>[^/]+)/(?P<path>
.+)$'
_BLOCKDEV_URI_REGEX_RBD: str =

Undocumented

Value
'^rbd:(?P<pool>\\w+)/(?P<image>[a-z0-9-\\.]+)$'