From 05c40f8a2d6f1a14595df964ad4850710b980f89 Mon Sep 17 00:00:00 2001 From: Shailesh Vashishth Date: Thu, 26 Feb 2026 11:50:37 +0530 Subject: [PATCH 1/2] Move hypervisor/virtual_machine from log to tracing crate Signed-off-by: Shailesh Vashishth --- .../src/hypervisor/virtual_machine/kvm.rs | 10 +++++----- .../src/hypervisor/virtual_machine/mshv.rs | 2 +- .../src/hypervisor/virtual_machine/whp.rs | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/hyperlight_host/src/hypervisor/virtual_machine/kvm.rs b/src/hyperlight_host/src/hypervisor/virtual_machine/kvm.rs index ecf3b6b91..a0382ab6c 100644 --- a/src/hyperlight_host/src/hypervisor/virtual_machine/kvm.rs +++ b/src/hyperlight_host/src/hypervisor/virtual_machine/kvm.rs @@ -69,16 +69,16 @@ pub(crate) fn is_hypervisor_present() -> bool { match api_version { version if version == 12 && kvm.check_extension(UserMemory) => true, 12 => { - log::info!("KVM does not have KVM_CAP_USER_MEMORY capability"); + tracing::info!("KVM does not have KVM_CAP_USER_MEMORY capability"); false } version => { - log::info!("KVM GET_API_VERSION returned {}, expected 12", version); + tracing::info!("KVM GET_API_VERSION returned {}, expected 12", version); false } } } else { - log::info!("KVM is not available on this system"); + tracing::info!("KVM is not available on this system"); false } } @@ -346,7 +346,7 @@ impl DebuggableVm for KvmVm { fn set_debug(&mut self, enable: bool) -> std::result::Result<(), DebugError> { use kvm_bindings::{KVM_GUESTDBG_ENABLE, KVM_GUESTDBG_USE_HW_BP, KVM_GUESTDBG_USE_SW_BP}; - log::info!("Setting debug to {}", enable); + tracing::info!("Setting debug to {}", enable); if enable { self.debug_regs.control |= KVM_GUESTDBG_ENABLE | KVM_GUESTDBG_USE_HW_BP | KVM_GUESTDBG_USE_SW_BP; @@ -363,7 +363,7 @@ impl DebuggableVm for KvmVm { fn set_single_step(&mut self, enable: bool) -> std::result::Result<(), DebugError> { use kvm_bindings::KVM_GUESTDBG_SINGLESTEP; - log::info!("Setting single step to {}", enable); + tracing::info!("Setting single step to {}", enable); if enable { self.debug_regs.control |= KVM_GUESTDBG_SINGLESTEP; } else { diff --git a/src/hyperlight_host/src/hypervisor/virtual_machine/mshv.rs b/src/hyperlight_host/src/hypervisor/virtual_machine/mshv.rs index b681acae3..705764dd6 100644 --- a/src/hyperlight_host/src/hypervisor/virtual_machine/mshv.rs +++ b/src/hyperlight_host/src/hypervisor/virtual_machine/mshv.rs @@ -56,7 +56,7 @@ pub(crate) fn is_hypervisor_present() -> bool { match Mshv::new() { Ok(_) => true, Err(_) => { - log::info!("MSHV is not available on this system"); + tracing::info!("MSHV is not available on this system"); false } } diff --git a/src/hyperlight_host/src/hypervisor/virtual_machine/whp.rs b/src/hyperlight_host/src/hypervisor/virtual_machine/whp.rs index c22e97ba3..07f4b5a97 100644 --- a/src/hyperlight_host/src/hypervisor/virtual_machine/whp.rs +++ b/src/hyperlight_host/src/hypervisor/virtual_machine/whp.rs @@ -59,7 +59,7 @@ pub(crate) fn is_hypervisor_present() -> bool { } { Ok(_) => unsafe { capability.HypervisorPresent.as_bool() }, Err(_) => { - log::info!("Windows Hypervisor Platform is not available on this system"); + tracing::info!("Windows Hypervisor Platform is not available on this system"); false } } @@ -770,7 +770,7 @@ impl Drop for WhpVm { // (HyperlightVm::drop() runs before its fields are dropped, so // set_dropped() completes before this Drop impl runs.) if let Err(e) = unsafe { WHvDeletePartition(self.partition) } { - log::error!("Failed to delete partition: {}", e); + tracing::error!("Failed to delete partition: {}", e); } } } From 3439e49078a61cb8fabb3c39d8824d8b9d800ff3 Mon Sep 17 00:00:00 2001 From: Shailesh Vashishth Date: Thu, 5 Mar 2026 12:11:35 +0530 Subject: [PATCH 2/2] mem_profile refactor to move to tracing crate Signed-off-by: Shailesh Vashishth --- src/hyperlight_host/src/sandbox/trace/mem_profile.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hyperlight_host/src/sandbox/trace/mem_profile.rs b/src/hyperlight_host/src/sandbox/trace/mem_profile.rs index 9b436145b..54905b272 100644 --- a/src/hyperlight_host/src/sandbox/trace/mem_profile.rs +++ b/src/hyperlight_host/src/sandbox/trace/mem_profile.rs @@ -63,7 +63,7 @@ impl MemTraceInfo { path.push(uuid::Uuid::new_v4().to_string()); path.set_extension("trace"); - log::info!("Creating trace file at: {}", path.display()); + tracing::info!("Creating trace file at: {}", path.display()); println!("Creating trace file at: {}", path.display()); let hash = unwind_module.hash();