Skip to content

Commit 9c65535

Browse files
authored
Move hypervisor/virtual_machine from log to tracing crate (#1276)
* Move hypervisor/virtual_machine from log to tracing crate Signed-off-by: Shailesh Vashishth <shavashishth@gmail.com> * mem_profile refactor to move to tracing crate Signed-off-by: Shailesh Vashishth <shavashishth@gmail.com> --------- Signed-off-by: Shailesh Vashishth <shavashishth@gmail.com>
1 parent e930c91 commit 9c65535

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

src/hyperlight_host/src/hypervisor/virtual_machine/kvm.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,16 +69,16 @@ pub(crate) fn is_hypervisor_present() -> bool {
6969
match api_version {
7070
version if version == 12 && kvm.check_extension(UserMemory) => true,
7171
12 => {
72-
log::info!("KVM does not have KVM_CAP_USER_MEMORY capability");
72+
tracing::info!("KVM does not have KVM_CAP_USER_MEMORY capability");
7373
false
7474
}
7575
version => {
76-
log::info!("KVM GET_API_VERSION returned {}, expected 12", version);
76+
tracing::info!("KVM GET_API_VERSION returned {}, expected 12", version);
7777
false
7878
}
7979
}
8080
} else {
81-
log::info!("KVM is not available on this system");
81+
tracing::info!("KVM is not available on this system");
8282
false
8383
}
8484
}
@@ -346,7 +346,7 @@ impl DebuggableVm for KvmVm {
346346
fn set_debug(&mut self, enable: bool) -> std::result::Result<(), DebugError> {
347347
use kvm_bindings::{KVM_GUESTDBG_ENABLE, KVM_GUESTDBG_USE_HW_BP, KVM_GUESTDBG_USE_SW_BP};
348348

349-
log::info!("Setting debug to {}", enable);
349+
tracing::info!("Setting debug to {}", enable);
350350
if enable {
351351
self.debug_regs.control |=
352352
KVM_GUESTDBG_ENABLE | KVM_GUESTDBG_USE_HW_BP | KVM_GUESTDBG_USE_SW_BP;
@@ -363,7 +363,7 @@ impl DebuggableVm for KvmVm {
363363
fn set_single_step(&mut self, enable: bool) -> std::result::Result<(), DebugError> {
364364
use kvm_bindings::KVM_GUESTDBG_SINGLESTEP;
365365

366-
log::info!("Setting single step to {}", enable);
366+
tracing::info!("Setting single step to {}", enable);
367367
if enable {
368368
self.debug_regs.control |= KVM_GUESTDBG_SINGLESTEP;
369369
} else {

src/hyperlight_host/src/hypervisor/virtual_machine/mshv.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ pub(crate) fn is_hypervisor_present() -> bool {
5656
match Mshv::new() {
5757
Ok(_) => true,
5858
Err(_) => {
59-
log::info!("MSHV is not available on this system");
59+
tracing::info!("MSHV is not available on this system");
6060
false
6161
}
6262
}

src/hyperlight_host/src/hypervisor/virtual_machine/whp.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ pub(crate) fn is_hypervisor_present() -> bool {
5959
} {
6060
Ok(_) => unsafe { capability.HypervisorPresent.as_bool() },
6161
Err(_) => {
62-
log::info!("Windows Hypervisor Platform is not available on this system");
62+
tracing::info!("Windows Hypervisor Platform is not available on this system");
6363
false
6464
}
6565
}
@@ -770,7 +770,7 @@ impl Drop for WhpVm {
770770
// (HyperlightVm::drop() runs before its fields are dropped, so
771771
// set_dropped() completes before this Drop impl runs.)
772772
if let Err(e) = unsafe { WHvDeletePartition(self.partition) } {
773-
log::error!("Failed to delete partition: {}", e);
773+
tracing::error!("Failed to delete partition: {}", e);
774774
}
775775
}
776776
}

src/hyperlight_host/src/sandbox/trace/mem_profile.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ impl MemTraceInfo {
6363
path.push(uuid::Uuid::new_v4().to_string());
6464
path.set_extension("trace");
6565

66-
log::info!("Creating trace file at: {}", path.display());
66+
tracing::info!("Creating trace file at: {}", path.display());
6767
println!("Creating trace file at: {}", path.display());
6868

6969
let hash = unwind_module.hash();

0 commit comments

Comments
 (0)