api2/tape/restore: return backup manifest in try_restore_snapshot_archive

we'll use that for partial snapshot restore

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak 2021-05-06 14:20:02 +02:00 committed by Dietmar Maurer
parent 94bc7957c1
commit 82a4bb5e80

View File

@ -800,7 +800,7 @@ fn try_restore_snapshot_archive<R: pxar::decoder::SeqRead>(
worker: Arc<WorkerTask>,
decoder: &mut pxar::decoder::sync::Decoder<R>,
snapshot_path: &Path,
) -> Result<(), Error> {
) -> Result<BackupManifest, Error> {
let _root = match decoder.next() {
None => bail!("missing root entry"),
@ -886,9 +886,10 @@ fn try_restore_snapshot_archive<R: pxar::decoder::SeqRead>(
}
}
if manifest.is_none() {
bail!("missing manifest");
}
let manifest = match manifest {
None => bail!("missing manifest"),
Some(manifest) => manifest,
};
// Do not verify anything here, because this would be to slow (causes tape stops).
@ -902,7 +903,7 @@ fn try_restore_snapshot_archive<R: pxar::decoder::SeqRead>(
bail!("Atomic rename manifest {:?} failed - {}", manifest_path, err);
}
Ok(())
Ok(manifest)
}
/// Try to restore media catalogs (form catalog_archives)