openvmm_helpers/snapshot/
restore.rs1use super::SnapshotManifest;
7use anyhow::Context;
8use std::path::Path;
9
10pub fn read_snapshot(dir: &Path) -> anyhow::Result<(SnapshotManifest, Vec<u8>)> {
15 let manifest_bytes =
16 fs_err::read(dir.join("manifest.bin")).context("failed to read manifest.bin")?;
17 let manifest: SnapshotManifest =
18 mesh::payload::decode(&manifest_bytes).context("failed to decode snapshot manifest")?;
19
20 let state_bytes = fs_err::read(dir.join("state.bin")).context("failed to read state.bin")?;
21
22 Ok((manifest, state_bytes))
23}