'Resize volume file to new size.'

def _resize_volume_file(self, volume, new_size):

    vol_path = self.local_path(volume)
    try:
        image_utils.resize_image(vol_path, new_size, run_as_root=True)
    except processutils.ProcessExecutionError as exc:
        LOG.error('Failed    to    resize    volume    %(volume_id)s,    error:    %(error)s.', {'volume_id': volume['id'], 'error': exc.stderr})
        raise exception.VolumeBackendAPIException(data=exc.stderr)
    data = image_utils.qemu_img_info(vol_path)
    return data.virtual_size
