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

Method save

crates/openshell-vfio/src/pci.rs:197–203  ·  view source on GitHub ↗
(&self, path: &Path)

Source from the content-addressed store, hash-verified

195 }
196
197 pub fn save(&self, path: &Path) -> Result<(), std::io::Error> {
198 let data = serde_json::to_string_pretty(self)
199 .map_err(|e| std::io::Error::new(std::io::ErrorKind::InvalidData, e))?;
200 let tmp = path.with_extension("tmp");
201 fs::write(&tmp, &data)?;
202 fs::rename(&tmp, path)
203 }
204}
205
206/// Enumerate every PCI device on the host that is structurally eligible

Calls

no outgoing calls