Enumerate all PCI BDFs in the given IOMMU group.
(&self, group_id: u32)
| 80 | |
| 81 | /// Enumerate all PCI BDFs in the given IOMMU group. |
| 82 | pub fn iommu_group_devices(&self, group_id: u32) -> Result<Vec<String>, VfioError> { |
| 83 | let group_dir = self |
| 84 | .base |
| 85 | .join(format!("kernel/iommu_groups/{group_id}/devices")); |
| 86 | let entries = fs::read_dir(&group_dir).map_err(|source| VfioError::SysfsIo { |
| 87 | path: group_dir.display().to_string(), |
| 88 | source, |
| 89 | })?; |
| 90 | let mut devices = Vec::new(); |
| 91 | for entry in entries.filter_map(Result::ok) { |
| 92 | devices.push(entry.file_name().to_string_lossy().into_owned()); |
| 93 | } |
| 94 | devices.sort(); |
| 95 | Ok(devices) |
| 96 | } |
| 97 | } |
| 98 | |
| 99 | impl SysfsPciDevice<'_> { |