MCPcopy Create free account
hub / github.com/cloud-hypervisor/cloud-hypervisor / is_available

Method is_available

hypervisor/src/kvm/mod.rs:1500–1508  ·  view source on GitHub ↗

Check if the hypervisor is available

()

Source from the content-addressed store, hash-verified

1498
1499 /// Check if the hypervisor is available
1500 pub fn is_available() -> hypervisor::Result<bool> {
1501 match std::fs::metadata("/dev/kvm") {
1502 Ok(_) => Ok(true),
1503 Err(err) if err.kind() == std::io::ErrorKind::NotFound => Ok(false),
1504 Err(err) => Err(hypervisor::HypervisorError::HypervisorAvailableCheck(
1505 err.into(),
1506 )),
1507 }
1508 }
1509}
1510
1511/// Implementation of Hypervisor trait for KVM

Callers

nothing calls this directly

Calls 1

kindMethod · 0.80

Tested by

no test coverage detected