diff --git a/src/runtime-rs/crates/hypervisor/src/device/device_manager.rs b/src/runtime-rs/crates/hypervisor/src/device/device_manager.rs
index 76eaba4e1d..376ed671d1 100644
--- a/src/runtime-rs/crates/hypervisor/src/device/device_manager.rs
+++ b/src/runtime-rs/crates/hypervisor/src/device/device_manager.rs
@@ -18,6 +18,7 @@ use crate::{
};
use super::{
+ topology::PCIeTopology,
util::{get_host_path, get_virt_drive_name, DEVICE_TYPE_BLOCK},
Device, DeviceConfig, DeviceType,
};
@@ -121,7 +122,9 @@ impl DeviceManager {
.context("failed to find device")?;
let mut device_guard = device.lock().await;
// attach device
- let result = device_guard.attach(self.hypervisor.as_ref()).await;
+ let result = device_guard
+ .attach(&mut None::<&mut PCIeTopology>, self.hypervisor.as_ref())
+ .await;
// handle attach error
if let Err(e) = result {
match device_guard.get_device_info().await {
@@ -161,7 +164,10 @@ impl DeviceManager {
pub async fn try_remove_device(&mut self, device_id: &str) -> Result<()> {
if let Some(dev) = self.devices.get(device_id) {
let mut device_guard = dev.lock().await;
- let result = match device_guard.detach(self.hypervisor.as_ref()).await {
+ let result = match device_guard
+ .detach(&mut None::<&mut PCIeTopology>, self.hypervisor.as_ref())
+ .await
+ {
Ok(index) => {
if let Some(i) = index {
// release the declared device index
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 958081d8eb..4c1f89e450 100644
--- a/src/runtime-rs/crates/hypervisor/src/device/driver/vfio.rs
+++ b/src/runtime-rs/crates/hypervisor/src/device/driver/vfio.rs
@@ -477,7 +477,11 @@ impl VfioDevice {
#[async_trait]
impl Device for VfioDevice {
- async fn attach(&mut self, h: &dyn hypervisor) -> Result<()> {
+ async fn attach(
+ &mut self,
+ _pcie_topo: &mut Option<&mut PCIeTopology>,
+ h: &dyn hypervisor,
+ ) -> Result<()> {
if self
.increase_attach_count()
.await
@@ -525,7 +529,11 @@ impl Device for VfioDevice {
}
}
- async fn detach(&mut self, h: &dyn hypervisor) -> Result