MCPcopy Create free account
hub / github.com/cloud-hypervisor/cloud-hypervisor / snapshot

Method snapshot

vmm/src/device_manager.rs:5617–5629  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

5615 }
5616
5617 fn snapshot(&mut self) -> std::result::Result<Snapshot, MigratableError> {
5618 let mut snapshot = Snapshot::from_data(SnapshotData::new_from_state(&self.state())?);
5619
5620 // We aggregate all devices snapshots.
5621 for (_, device_node) in self.device_tree.lock().unwrap().iter() {
5622 if let Some(migratable) = &device_node.migratable {
5623 let mut migratable = migratable.lock().unwrap();
5624 snapshot.add_snapshot(migratable.id(), migratable.snapshot()?);
5625 }
5626 }
5627
5628 Ok(snapshot)
5629 }
5630}
5631
5632impl Transportable for DeviceManager {}

Callers

nothing calls this directly

Calls 4

iterMethod · 0.80
add_snapshotMethod · 0.80
stateMethod · 0.45
idMethod · 0.45

Tested by

no test coverage detected