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

Function ensure_bound_to_vfio

crates/openshell-vfio/src/pci.rs:145–155  ·  view source on GitHub ↗
(sysfs: &SysfsRoot, bdf: &str)

Source from the content-addressed store, hash-verified

143}
144
145fn ensure_bound_to_vfio(sysfs: &SysfsRoot, bdf: &str) -> Result<(), VfioError> {
146 let driver = crate::bind::current_driver_name(sysfs, bdf);
147 if driver.as_deref() == Some("vfio-pci") {
148 return Ok(());
149 }
150
151 Err(VfioError::NotBoundToVfio {
152 bdf: bdf.to_string(),
153 driver: driver.unwrap_or_else(|| "<none>".to_string()),
154 })
155}
156
157impl Drop for PciBindGuard {
158 fn drop(&mut self) {

Callers 2

adoptMethod · 0.85
adopt_groupMethod · 0.85

Calls 1

current_driver_nameFunction · 0.85

Tested by

no test coverage detected