mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vm-migration: Don't store the id as part of Snapshot structure
The information about the identifier related to a Snapshot is only relevant from the BTreeMap perspective, which is why we can get rid of the duplicated identifier in every Snapshot structure. Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
@@ -4445,13 +4445,13 @@ impl Snapshottable for DeviceManager {
|
||||
}
|
||||
|
||||
fn snapshot(&mut self) -> std::result::Result<Snapshot, MigratableError> {
|
||||
let mut snapshot = Snapshot::new(DEVICE_MANAGER_SNAPSHOT_ID);
|
||||
let mut snapshot = Snapshot::default();
|
||||
|
||||
// We aggregate all devices snapshots.
|
||||
for (_, device_node) in self.device_tree.lock().unwrap().iter() {
|
||||
if let Some(migratable) = &device_node.migratable {
|
||||
let device_snapshot = migratable.lock().unwrap().snapshot()?;
|
||||
snapshot.add_snapshot(device_snapshot);
|
||||
let mut migratable = migratable.lock().unwrap();
|
||||
snapshot.add_snapshot(migratable.id(), migratable.snapshot()?);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user