'Copy data from snapshot to destination volume.
This is done with a qemu-img convert to raw/qcow2 from the snapshot
qcow2.'

def _copy_volume_from_snapshot(self, snapshot, volume, volume_size):

    LOG.debug('snapshot:    %(snap)s,    volume:    %(vol)s,    ', {'snap': snapshot.id, 'vol': volume.id, 'size': volume_size})
    info_path = self._local_path_volume_info(snapshot.volume)
    snap_info = self._read_info_file(info_path)
    vol_path = self._local_volume_dir(snapshot.volume)
    forward_file = snap_info[snapshot.id]
    forward_path = os.path.join(vol_path, forward_file)
    img_info = self._qemu_img_info(forward_path, snapshot.volume.name)
    path_to_snap_img = os.path.join(vol_path, img_info.backing_file)
    path_to_new_vol = self._local_path_volume(volume)
    LOG.debug('will    copy    from    snapshot    at    %s', path_to_snap_img)
    if self.configuration.quobyte_qcow2_volumes:
        out_format = 'qcow2'
    else:
        out_format = 'raw'
    image_utils.convert_image(path_to_snap_img, path_to_new_vol, out_format, run_as_root=self._execute_as_root)
    self._set_rw_permissions_for_all(path_to_new_vol)
