'Image initialization.
:param path: libvirt\'s representation of the path of this disk.
:param source_type: block or file
:param driver_format: raw or qcow2
:param is_block_dev:'

def __init__(self, path, source_type, driver_format, is_block_dev=False):

    if (CONF.ephemeral_storage_encryption.enabled and (not self._supports_encryption())):
        msg = _('Incompatible    settings:    ephemeral    storage    encryption    is    supported    only    for    LVM    images.')
        raise exception.InternalError(msg)
    self.path = path
    self.source_type = source_type
    self.driver_format = driver_format
    self.driver_io = None
    self.discard_mode = CONF.libvirt.hw_disk_discard
    self.is_block_dev = is_block_dev
    self.preallocate = False
    self.disk_info_path = None
    self.lock_path = os.path.join(CONF.instances_path, 'locks')
