(dir: &Path)
| 107 | } |
| 108 | |
| 109 | pub 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 | |
| 127 | fn runtime_cache_key() -> String { |
| 128 | let mut fp: u64 = 0; |
no test coverage detected