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

Function check_kvm_access

crates/openshell-driver-vm/src/runtime.rs:1391–1399  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1389
1390#[cfg(target_os = "linux")]
1391fn check_kvm_access() -> Result<(), String> {
1392 std::fs::OpenOptions::new()
1393 .read(true)
1394 .open("/dev/kvm")
1395 .map(|_| ())
1396 .map_err(|e| {
1397 format!("cannot open /dev/kvm: {e}\nKVM access is required to run microVMs on Linux.")
1398 })
1399}
1400
1401#[cfg(test)]
1402mod tests {

Callers 2

run_qemu_vmFunction · 0.85
run_libkrun_vmFunction · 0.85

Calls 1

readMethod · 0.45

Tested by

no test coverage detected