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

Function validate_runtime_dir

crates/openshell-driver-vm/src/embedded_runtime.rs:109–125  ·  view source on GitHub ↗
(dir: &Path)

Source from the content-addressed store, hash-verified

107}
108
109pub fn validate_runtime_dir(dir: &Path) -> Result<(), String> {
110 let libkrun = dir.join(resources::LIBKRUN_NAME);
111 let libkrunfw = dir.join(resources::LIBKRUNFW_NAME);
112 let gvproxy = dir.join("gvproxy");
113
114 for path in [&libkrun, &libkrunfw, &gvproxy] {
115 if !path.is_file() {
116 return Err(format!("missing runtime file: {}", path.display()));
117 }
118 let size = fs::metadata(path).map_or(0, |m| m.len());
119 if size == 0 {
120 return Err(format!("runtime file is empty (stub): {}", path.display()));
121 }
122 }
123
124 Ok(())
125}
126
127fn runtime_cache_key() -> String {
128 let mut fp: u64 = 0;

Callers 1

ensure_runtime_extractedFunction · 0.70

Calls 1

lenMethod · 0.80

Tested by

no test coverage detected