openvmm_hypervisors/
lib.rs1#![forbid(unsafe_code)]
13
14pub mod hvf;
15pub mod kvm;
16pub mod mshv;
17pub mod whp;
18
19hypervisor_resources::register_hypervisor_probes! {
21 #[cfg(all(target_os = "linux", feature = "virt_mshv", guest_is_native))]
22 mshv::MshvProbe,
23
24 #[cfg(all(target_os = "linux", feature = "virt_kvm", guest_is_native))]
25 kvm::KvmProbe,
26
27 #[cfg(all(target_os = "windows", feature = "virt_whp", guest_is_native))]
28 whp::WhpProbe,
29
30 #[cfg(all(target_os = "macos", guest_arch = "aarch64", guest_is_native, feature = "virt_hvf"))]
31 hvf::HvfProbe,
32}
33
34#[expect(clippy::allow_attributes, reason = "lots of conditions")]
35#[allow(dead_code)]
36pub(crate) fn parse_bool_param(key: &str, val: &str) -> anyhow::Result<bool> {
37 match val {
38 "true" | "1" | "yes" => Ok(true),
39 "false" | "0" | "no" => Ok(false),
40 _ => anyhow::bail!("invalid boolean value for {key}: {val}"),
41 }
42}