MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / iommu_group_devices

Method iommu_group_devices

crates/openshell-vfio/src/sysfs.rs:82–96  ·  view source on GitHub ↗

Enumerate all PCI BDFs in the given IOMMU group.

(&self, group_id: u32)

Source from the content-addressed store, hash-verified

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
99impl SysfsPciDevice<'_> {

Calls 1

pushMethod · 0.80