(&mut self)
| 156 | |
| 157 | impl Drop for PciBindGuard { |
| 158 | fn drop(&mut self) { |
| 159 | if self.disarmed { |
| 160 | return; |
| 161 | } |
| 162 | if self.vfio_id.is_some() { |
| 163 | self.restore_with_cached_id(); |
| 164 | } else { |
| 165 | for peer in &self.companion_bdfs { |
| 166 | if let Err(err) = crate::bind::restore_to_host_driver(&self.sysfs, peer) { |
| 167 | tracing::error!(bdf = %peer, error = %err, "failed to restore companion device to host driver on drop"); |
| 168 | } |
| 169 | } |
| 170 | if let Err(err) = crate::bind::restore_to_host_driver(&self.sysfs, &self.bdf) { |
| 171 | tracing::error!(bdf = %self.bdf, error = %err, "failed to restore PCI device to host driver on drop"); |
| 172 | } |
| 173 | } |
| 174 | } |
| 175 | } |
| 176 | |
| 177 | /// Persisted record of PCI devices currently bound to vfio-pci, for crash recovery. |
nothing calls this directly
no test coverage detected