(&mut self)
| 5567 | |
| 5568 | impl Pausable for DeviceManager { |
| 5569 | fn pause(&mut self) -> result::Result<(), MigratableError> { |
| 5570 | for (_, device_node) in self.device_tree.lock().unwrap().iter() { |
| 5571 | if let Some(migratable) = &device_node.migratable { |
| 5572 | match migratable.lock().unwrap().pause() { |
| 5573 | Ok(()) => {} |
| 5574 | Err(MigratableError::DeviceDisconnected(id)) => { |
| 5575 | warn!("Skipping pause for disconnected device {id}"); |
| 5576 | } |
| 5577 | Err(e) => return Err(e), |
| 5578 | } |
| 5579 | } |
| 5580 | } |
| 5581 | // On AArch64, the pause of device manager needs to trigger |
| 5582 | // a "pause" of GIC, which will flush the GIC pending tables |
| 5583 | // and ITS tables to guest RAM. |
| 5584 | #[cfg(target_arch = "aarch64")] |
| 5585 | { |
| 5586 | self.get_interrupt_controller() |
| 5587 | .unwrap() |
| 5588 | .lock() |
| 5589 | .unwrap() |
| 5590 | .pause()?; |
| 5591 | }; |
| 5592 | |
| 5593 | Ok(()) |
| 5594 | } |
| 5595 | |
| 5596 | fn resume(&mut self) -> result::Result<(), MigratableError> { |
| 5597 | for (_, device_node) in self.device_tree.lock().unwrap().iter() { |
nothing calls this directly
no test coverage detected