Skip to content

Commit a9be4b3

Browse files
committed
Remove unnecessary check for hypervisor present
Check for hypervisor presence is done in the hypervisor_handler module before trying to create the driver Signed-off-by: Simon Davies <[email protected]>
1 parent d2d78f6 commit a9be4b3

File tree

3 files changed

+1
-9
lines changed

3 files changed

+1
-9
lines changed

src/hyperlight_host/src/hypervisor/hyperv_linux.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,6 @@ impl HypervLinuxDriver {
8484
rsp_ptr: GuestPtr,
8585
pml4_ptr: GuestPtr,
8686
) -> Result<Self> {
87-
if !is_hypervisor_present() {
88-
log_then_return!("Hyper-V is not present on this system");
89-
}
9087
let mshv = Mshv::new()?;
9188
let pr = Default::default();
9289
let vm_fd = mshv.create_vm_with_config(&pr)?;

src/hyperlight_host/src/hypervisor/hyperv_windows.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,6 @@ impl HypervWindowsDriver {
7575
entrypoint: u64,
7676
rsp: u64,
7777
) -> Result<Self> {
78-
if !whp::is_hypervisor_present() {
79-
log_then_return!(NoHypervisorFound());
80-
}
8178

8279
// create and setup hypervisor partition
8380
let mut partition = VMPartition::new(1)?;

src/hyperlight_host/src/hypervisor/kvm.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,7 @@ impl KVMDriver {
7676
entrypoint: u64,
7777
rsp: u64,
7878
) -> Result<Self> {
79-
if !is_hypervisor_present() {
80-
log_then_return!("KVM is not present");
81-
};
79+
8280
let kvm = Kvm::new()?;
8381

8482
let vm_fd = kvm.create_vm_with_type(0)?;

0 commit comments

Comments
 (0)