diff --git a/src/runtime-rs/crates/hypervisor/src/device/driver/vfio.rs b/src/runtime-rs/crates/hypervisor/src/device/driver/vfio.rs index 292d53b206..7d8abd2e09 100644 --- a/src/runtime-rs/crates/hypervisor/src/device/driver/vfio.rs +++ b/src/runtime-rs/crates/hypervisor/src/device/driver/vfio.rs @@ -482,7 +482,7 @@ impl Device for VfioDevice { async fn detach( &mut self, - _pcie_topo: &mut Option<&mut PCIeTopology>, + pcie_topo: &mut Option<&mut PCIeTopology>, h: &dyn hypervisor, ) -> Result> { if self @@ -505,6 +505,8 @@ impl Device for VfioDevice { None }; + unregister_pcie_device!(self, pcie_topo)?; + Ok(device_index) }