Skip to content

Commit e4e3563

Browse files
committed
Consolidate duplicate HypervisorType enum
Removed duplicate HypervisorType enum definition from sandbox/hypervisor.rs and added import to use the existing definition from virtual_machine module. Both enums were identical, so consolidating reduces code duplication and ensures a single source of truth for the hypervisor type enumeration. Fixes #1202
1 parent 4e1ec7d commit e4e3563

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed

src/hyperlight_host/src/sandbox/hypervisor.rs

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ use std::sync::OnceLock;
2121
use crate::hypervisor::virtual_machine::kvm;
2222
#[cfg(mshv3)]
2323
use crate::hypervisor::virtual_machine::mshv;
24+
use crate::hypervisor::virtual_machine::HypervisorType;
2425

2526
static AVAILABLE_HYPERVISOR: OnceLock<Option<HypervisorType>> = OnceLock::new();
2627

@@ -65,19 +66,6 @@ pub fn get_available_hypervisor() -> &'static Option<HypervisorType> {
6566
})
6667
}
6768

68-
/// The hypervisor types available for the current platform
69-
#[derive(PartialEq, Eq, Debug)]
70-
pub(crate) enum HypervisorType {
71-
#[cfg(kvm)]
72-
Kvm,
73-
74-
#[cfg(mshv3)]
75-
Mshv,
76-
77-
#[cfg(target_os = "windows")]
78-
Whp,
79-
}
80-
8169
// Compiler error if no hypervisor type is available
8270
#[cfg(not(any(kvm, mshv3, target_os = "windows")))]
8371
compile_error!(

0 commit comments

Comments
 (0)