(
&mut self,
)
| 4346 | } |
| 4347 | |
| 4348 | fn add_pvpanic_device( |
| 4349 | &mut self, |
| 4350 | ) -> DeviceManagerResult<Option<Arc<Mutex<devices::PvPanicDevice>>>> { |
| 4351 | let id = String::from(PVPANIC_DEVICE_NAME); |
| 4352 | let pci_segment_id = 0x0_u16; |
| 4353 | |
| 4354 | info!("Creating pvpanic device {id}"); |
| 4355 | |
| 4356 | let (pci_segment_id, pci_device_bdf, resources) = |
| 4357 | self.pci_resources(&id, pci_segment_id, None)?; |
| 4358 | |
| 4359 | let snapshot = snapshot_from_id(self.snapshot.as_ref(), id.as_str()); |
| 4360 | |
| 4361 | let pvpanic_device = devices::PvPanicDevice::new(id.clone(), snapshot) |
| 4362 | .map_err(DeviceManagerError::PvPanicCreate)?; |
| 4363 | |
| 4364 | let pvpanic_device = Arc::new(Mutex::new(pvpanic_device)); |
| 4365 | |
| 4366 | let new_resources = self.add_pci_device( |
| 4367 | pvpanic_device.clone(), |
| 4368 | pvpanic_device.clone(), |
| 4369 | pci_segment_id, |
| 4370 | pci_device_bdf, |
| 4371 | resources, |
| 4372 | )?; |
| 4373 | |
| 4374 | let mut node = device_node!(id, pvpanic_device); |
| 4375 | |
| 4376 | node.resources = new_resources; |
| 4377 | node.pci_bdf = Some(pci_device_bdf); |
| 4378 | node.pci_device_handle = None; |
| 4379 | |
| 4380 | self.device_tree.lock().unwrap().insert(id, node); |
| 4381 | |
| 4382 | Ok(Some(pvpanic_device)) |
| 4383 | } |
| 4384 | |
| 4385 | #[cfg(feature = "ivshmem")] |
| 4386 | fn add_ivshmem_device( |
no test coverage detected