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:
@@ -381,7 +381,7 @@ impl Snapshottable for Blk {
|
||||
}
|
||||
|
||||
fn snapshot(&mut self) -> std::result::Result<Snapshot, MigratableError> {
|
||||
self.vu_common.snapshot(&self.id(), &self.state())
|
||||
self.vu_common.snapshot(&self.state())
|
||||
}
|
||||
}
|
||||
impl Transportable for Blk {}
|
||||
|
||||
@@ -651,7 +651,7 @@ impl Snapshottable for Fs {
|
||||
}
|
||||
|
||||
fn snapshot(&mut self) -> std::result::Result<Snapshot, MigratableError> {
|
||||
self.vu_common.snapshot(&self.id(), &self.state())
|
||||
self.vu_common.snapshot(&self.state())
|
||||
}
|
||||
}
|
||||
impl Transportable for Fs {}
|
||||
|
||||
@@ -430,15 +430,11 @@ impl VhostUserCommon {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn snapshot<T>(
|
||||
&mut self,
|
||||
id: &str,
|
||||
state: &T,
|
||||
) -> std::result::Result<Snapshot, MigratableError>
|
||||
pub fn snapshot<T>(&mut self, state: &T) -> std::result::Result<Snapshot, MigratableError>
|
||||
where
|
||||
T: Versionize + VersionMapped,
|
||||
{
|
||||
let snapshot = Snapshot::new_from_versioned_state(id, state)?;
|
||||
let snapshot = Snapshot::new_from_versioned_state(state)?;
|
||||
|
||||
if self.migration_started {
|
||||
self.shutdown();
|
||||
|
||||
@@ -418,7 +418,7 @@ impl Snapshottable for Net {
|
||||
}
|
||||
|
||||
fn snapshot(&mut self) -> std::result::Result<Snapshot, MigratableError> {
|
||||
self.vu_common.snapshot(&self.id(), &self.state())
|
||||
self.vu_common.snapshot(&self.state())
|
||||
}
|
||||
}
|
||||
impl Transportable for Net {}
|
||||
|
||||
Reference in New Issue
Block a user