mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vm-migration: Snapshot should have a unique SnapshotDataSection
There's no reason to carry a HashMap of SnapshotDataSection per Snapshot. And given we now provide at most one SnapshotDataSection per Snapshot, there's no need to keep the id part of the SnapshotDataSection structure. Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
@@ -1160,9 +1160,8 @@ impl MemoryManager {
|
||||
let mut memory_file_path = url_to_path(source_url).map_err(Error::Restore)?;
|
||||
memory_file_path.push(String::from(SNAPSHOT_FILENAME));
|
||||
|
||||
let mem_snapshot: MemoryManagerSnapshotData = snapshot
|
||||
.to_versioned_state(MEMORY_MANAGER_SNAPSHOT_ID)
|
||||
.map_err(Error::Restore)?;
|
||||
let mem_snapshot: MemoryManagerSnapshotData =
|
||||
snapshot.to_versioned_state().map_err(Error::Restore)?;
|
||||
|
||||
let mm = MemoryManager::new(
|
||||
vm,
|
||||
@@ -2444,7 +2443,6 @@ impl Snapshottable for MemoryManager {
|
||||
self.snapshot_memory_ranges = memory_ranges;
|
||||
|
||||
memory_manager_snapshot.add_data_section(SnapshotDataSection::new_from_versioned_state(
|
||||
MEMORY_MANAGER_SNAPSHOT_ID,
|
||||
&self.snapshot_data(),
|
||||
)?);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user