'Perform the actual restore operation.
:param backup_path: the path the backup was created from, this
identifies the backup to tsm
:param restore_path: volume path to restore into
:param vol_id: volume id
:param backup_mode: mode used to create the backup (\'image\' or \'file\')
:raises: InvalidBackup'

def _do_restore(self, backup_path, restore_path, vol_id, backup_mode):

    restore_attrs = {'Total    number    of    objects    restored': '1'}
    restore_cmd = ['dsmc', 'restore']
    if _image_mode(backup_mode):
        restore_cmd.append('image')
        restore_cmd.append('-noprompt')
    else:
        restore_cmd.append('-replace=yes')
    restore_cmd.extend(['-quiet', ('-password=%s' % self.tsm_password), backup_path])
    if (restore_path != backup_path):
        restore_cmd.append(restore_path)
    (out, err) = utils.execute(run_as_root=True, check_exit_code=False, *restore_cmd)
    success = _check_dsmc_output(out, restore_attrs)
    if (not success):
        err = (_('restore:    %(vol_id)s    failed.\nstdout:    %(out)s\n    stderr:    %(err)s.') % {'vol_id': vol_id, 'out': out, 'err': err})
        LOG.error(err)
        raise exception.InvalidBackup(reason=err)
