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

Function libkrun

crates/openshell-driver-vm/src/ffi.rs:97–106  ·  view source on GitHub ↗
(runtime_dir: &Path)

Source from the content-addressed store, hash-verified

95static LIBKRUN: OnceLock<LibKrun> = OnceLock::new();
96
97pub fn libkrun(runtime_dir: &Path) -> Result<&'static LibKrun, String> {
98 if let Some(lib) = LIBKRUN.get() {
99 return Ok(lib);
100 }
101
102 validate_runtime_dir(runtime_dir)?;
103 let loaded = LibKrun::load(runtime_dir)?;
104 let _ = LIBKRUN.set(loaded);
105 Ok(LIBKRUN.get().expect("libkrun should be initialized"))
106}
107
108pub fn required_runtime_lib_name() -> &'static str {
109 #[cfg(target_os = "macos")]

Callers 1

createMethod · 0.85

Calls 4

loadFunction · 0.85
validate_runtime_dirFunction · 0.70
getMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected