Skip to content

Commit 66fe6f0

Browse files
committed
fix(driver-vm): satisfy linux clippy item order
1 parent 13bae67 commit 66fe6f0

1 file changed

Lines changed: 11 additions & 11 deletions

File tree

crates/openshell-driver-vm/src/runtime.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1325,6 +1325,17 @@ fn path_to_cstring(path: &Path) -> Result<CString, String> {
13251325
CString::new(path).map_err(|e| format!("invalid path string {path}: {e}"))
13261326
}
13271327

1328+
#[cfg(target_os = "linux")]
1329+
fn check_kvm_access() -> Result<(), String> {
1330+
std::fs::OpenOptions::new()
1331+
.read(true)
1332+
.open("/dev/kvm")
1333+
.map(|_| ())
1334+
.map_err(|e| {
1335+
format!("cannot open /dev/kvm: {e}\nKVM access is required to run microVMs on Linux.")
1336+
})
1337+
}
1338+
13281339
#[cfg(test)]
13291340
mod tests {
13301341
use super::*;
@@ -1374,14 +1385,3 @@ mod tests {
13741385
assert!(!cmdline.contains("GPU_ENABLED="));
13751386
}
13761387
}
1377-
1378-
#[cfg(target_os = "linux")]
1379-
fn check_kvm_access() -> Result<(), String> {
1380-
std::fs::OpenOptions::new()
1381-
.read(true)
1382-
.open("/dev/kvm")
1383-
.map(|_| ())
1384-
.map_err(|e| {
1385-
format!("cannot open /dev/kvm: {e}\nKVM access is required to run microVMs on Linux.")
1386-
})
1387-
}

0 commit comments

Comments
 (0)