runtime-rs: do unregister device in Trait Device/detach

Fixes: #7218

Signed-off-by: alex.lyn <alex.lyn@antgroup.com>
This commit is contained in:
alex.lyn
2023-12-27 15:52:26 +08:00
parent 0f0b6d13c9
commit b42548b8e1

View File

@@ -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<Option<u64>> {
if self
@@ -505,6 +505,8 @@ impl Device for VfioDevice {
None
};
unregister_pcie_device!(self, pcie_topo)?;
Ok(device_index)
}