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

Method shutdown

vmm/src/cpu.rs:1608–1628  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

1606 }
1607
1608 pub fn shutdown(&mut self) -> Result<()> {
1609 // Tell the vCPUs to stop themselves next time they go through the loop
1610 self.vcpus_kill_signalled.store(true, Ordering::SeqCst);
1611
1612 // Toggle the vCPUs pause boolean
1613 self.vcpus_pause_signalled.store(false, Ordering::SeqCst);
1614
1615 // Unpark all the VCPU threads.
1616 for state in self.vcpu_states.lock().unwrap().iter() {
1617 state.unpark_thread();
1618 }
1619
1620 self.signal_vcpus()?;
1621
1622 // Wait for all the threads to finish. This removes the state from the vector.
1623 for mut state in self.vcpu_states.lock().unwrap().drain(..) {
1624 state.join_thread()?;
1625 }
1626
1627 Ok(())
1628 }
1629
1630 #[cfg(feature = "tdx")]
1631 pub fn initialize_tdx(&self, hob_address: u64) -> Result<()> {

Callers

nothing calls this directly

Calls 4

iterMethod · 0.80
unpark_threadMethod · 0.80
signal_vcpusMethod · 0.80
join_threadMethod · 0.80

Tested by

no test coverage detected