diff --git a/src/runtime-rs/crates/hypervisor/src/device/driver/mod.rs b/src/runtime-rs/crates/hypervisor/src/device/driver/mod.rs index 2aff85b8c4..8ccc3dfc68 100644 --- a/src/runtime-rs/crates/hypervisor/src/device/driver/mod.rs +++ b/src/runtime-rs/crates/hypervisor/src/device/driver/mod.rs @@ -12,8 +12,8 @@ mod virtio_net; mod virtio_vsock; pub use vfio::{ - bind_device_to_host, bind_device_to_vfio, get_host_guest_map, get_vfio_device, HostDevice, - VfioBusMode, VfioConfig, VfioDevice, + bind_device_to_host, bind_device_to_vfio, get_vfio_device, HostDevice, VfioBusMode, VfioConfig, + VfioDevice, }; pub use virtio_blk::{ BlockConfig, BlockDevice, KATA_BLK_DEV_TYPE, KATA_MMIO_BLK_DEV_TYPE, KATA_NVDIMM_DEV_TYPE, @@ -207,11 +207,4 @@ mod tests { assert!(root_slot.is_some()); assert_eq!(root_slot.unwrap().0, 1); } - - #[test] - fn test_get_host_guest_map() { - // test unwrap is fine, no panic occurs. - let hg_map = get_host_guest_map("".to_owned()); - assert!(hg_map.is_none()); - } } 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 07890de659..be1eb3cb52 100644 --- a/src/runtime-rs/crates/hypervisor/src/device/driver/vfio.rs +++ b/src/runtime-rs/crates/hypervisor/src/device/driver/vfio.rs @@ -70,12 +70,6 @@ pub fn generate_guest_pci_path(bdf: String) -> Result { }) } -// get host/guest mapping for info -pub fn get_host_guest_map(host_bdf: String) -> Option { - // safe, just do unwrap as `HOST_GUEST_MAP` is always valid. - HOST_GUEST_MAP.read().unwrap().get(&host_bdf).cloned() -} - pub fn do_check_iommu_on() -> Result { let element = std::fs::read_dir(SYS_CLASS_IOMMU)? .filter_map(|e| e.ok())