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

Method is_available

hypervisor/src/mshv/mod.rs:241–249  ·  view source on GitHub ↗

Check if the hypervisor is available

()

Source from the content-addressed store, hash-verified

239 }
240 /// Check if the hypervisor is available
241 pub fn is_available() -> hypervisor::Result<bool> {
242 match std::fs::metadata("/dev/mshv") {
243 Ok(_) => Ok(true),
244 Err(err) if err.kind() == std::io::ErrorKind::NotFound => Ok(false),
245 Err(err) => Err(hypervisor::HypervisorError::HypervisorAvailableCheck(
246 err.into(),
247 )),
248 }
249 }
250}
251
252/// Implementation of Hypervisor trait for Mshv

Callers

nothing calls this directly

Calls 1

kindMethod · 0.80

Tested by

no test coverage detected