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:
@@ -399,12 +399,11 @@ impl Snapshottable for Vcpu {
|
||||
.state()
|
||||
.map_err(|e| MigratableError::Pause(anyhow!("Could not get vCPU state {:?}", e)))?;
|
||||
|
||||
let mut vcpu_snapshot = Snapshot::default();
|
||||
vcpu_snapshot.add_data(SnapshotData::new_from_state(&saved_state)?);
|
||||
self.saved_state = Some(saved_state.clone());
|
||||
|
||||
self.saved_state = Some(saved_state);
|
||||
|
||||
Ok(vcpu_snapshot)
|
||||
Ok(Snapshot::from_data(SnapshotData::new_from_state(
|
||||
&saved_state,
|
||||
)?))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user