(&mut self)
| 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<()> { |
nothing calls this directly
no test coverage detected