Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 4 additions & 9 deletions src/hyperlight_host/src/hypervisor/hyperv_linux.rs
Original file line number Diff line number Diff line change
Expand Up @@ -271,15 +271,10 @@ mod debug {
/// and functional.
#[instrument(skip_all, parent = Span::current(), level = "Trace")]
pub(crate) fn is_hypervisor_present() -> bool {
match Mshv::open_with_cloexec(true) {
Ok(fd) => {
unsafe {
libc::close(fd);
} // must explicitly close fd to avoid a leak
true
}
Err(e) => {
log::info!("Error creating MSHV object: {:?}", e);
match Mshv::new() {
Ok(_) => true,
Err(_) => {
log::info!("MSHV is not available on this system");
false
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/hyperlight_host/src/hypervisor/kvm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ pub(crate) fn is_hypervisor_present() -> bool {
}
}
} else {
log::info!("Error creating KVM object");
log::info!("KVM is not available on this system");
false
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@ pub(crate) fn is_hypervisor_present() -> bool {
)
} {
Ok(_) => unsafe { capability.HypervisorPresent.as_bool() },
Err(_) => false,
Err(_) => {
log::info!("Windows Hypervisor Platform is not available on this system");
false
}
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/tests/rust_guests/callbackguest/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/tests/rust_guests/simpleguest/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.