Skip to content

Commit 9282fc7

Browse files
committed
More logging
Signed-off-by: Simon Davies <[email protected]>
1 parent 0cc6be5 commit 9282fc7

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

src/hyperlight_host/src/hypervisor/hypervisor_handler.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,10 @@ impl HypervisorHandler {
8787
pub(crate) fn set_run_cancelled(&self, run_cancelled: bool) {
8888
self.execution_variables.run_cancelled.store(run_cancelled);
8989
}
90+
91+
pub(crate) fn get_id(&self) -> String {
92+
self.id.clone()
93+
}
9094
}
9195

9296
// Note: `join_handle` and `running` have to be `Arc` because we need
@@ -948,12 +952,16 @@ fn set_up_hypervisor_partition(
948952
match *get_available_hypervisor() {
949953
#[cfg(mshv)]
950954
Some(HypervisorType::Mshv) => {
955+
log::debug!("Creating mshv hypervisor driver");
951956
let hv = crate::hypervisor::hyperv_linux::HypervLinuxDriver::new(
952957
regions,
953958
entrypoint_ptr,
954959
rsp_ptr,
955960
pml4_ptr,
956-
)?;
961+
)
962+
.inspect_err(|e| {
963+
log::debug!("Failed to create mshv hypervisor driver: {:#}", e);
964+
})?;
957965
Ok(Box::new(hv))
958966
}
959967

src/hyperlight_host/src/sandbox/uninitialized_evolve.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,15 @@ fn hv_init(
146146

147147
hv_handler
148148
.execute_hypervisor_handler_action(HypervisorHandlerAction::Initialise)
149-
.map_err(|exec_e| match hv_handler.kill_hypervisor_handler_thread() {
150-
Ok(_) => exec_e,
151-
Err(kill_e) => new_error!("{}", format!("{}, {}", exec_e, kill_e)),
149+
.map_err(|exec_e| {
150+
log::debug!(
151+
"error executing hypervisor handler action: {exec_e} id: {}",
152+
hv_handler.get_id()
153+
);
154+
match hv_handler.kill_hypervisor_handler_thread() {
155+
Ok(_) => exec_e,
156+
Err(kill_e) => new_error!("{}", format!("{}, {}", exec_e, kill_e)),
157+
}
152158
})?;
153159

154160
Ok(hv_handler)

0 commit comments

Comments
 (0)