(sysfs: &SysfsRoot, bdf: &str)
| 143 | } |
| 144 | |
| 145 | fn 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 | |
| 157 | impl Drop for PciBindGuard { |
| 158 | fn drop(&mut self) { |
no test coverage detected