mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vm-migration: Introduce new constructor for Snapshot
This simplifies the Snapshot creation as we expect a SnapshotData to be provided most of the time. Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
@@ -4445,7 +4445,7 @@ impl Snapshottable for DeviceManager {
|
||||
}
|
||||
|
||||
fn snapshot(&mut self) -> std::result::Result<Snapshot, MigratableError> {
|
||||
let mut snapshot = Snapshot::default();
|
||||
let mut snapshot = Snapshot::from_data(SnapshotData::new_from_state(&self.state())?);
|
||||
|
||||
// We aggregate all devices snapshots.
|
||||
for (_, device_node) in self.device_tree.lock().unwrap().iter() {
|
||||
@@ -4455,9 +4455,6 @@ impl Snapshottable for DeviceManager {
|
||||
}
|
||||
}
|
||||
|
||||
// Then we store the DeviceManager state.
|
||||
snapshot.add_data(SnapshotData::new_from_state(&self.state())?);
|
||||
|
||||
Ok(snapshot)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user