Skip to content

Commit 57cce76

Browse files
committed
Remove outb_handler_wrapper function
Signed-off-by: Simon Davies <[email protected]>
1 parent 7e4517c commit 57cce76

File tree

1 file changed

+5
-29
lines changed
  • src/hyperlight_host/src/sandbox

1 file changed

+5
-29
lines changed

src/hyperlight_host/src/sandbox/outb.rs

Lines changed: 5 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,15 @@ use tracing_log::format_trace;
3434

3535
use super::host_funcs::FunctionRegistry;
3636
use super::mem_mgr::MemMgrWrapper;
37-
use crate::hypervisor::handlers::{OutBHandler, OutBHandlerFunction, OutBHandlerWrapper};
37+
#[cfg(feature = "trace_guest")]
38+
use crate::hypervisor::Hypervisor;
3839
#[cfg(feature = "trace_guest")]
3940
use crate::mem::layout::SandboxMemoryLayout;
4041
use crate::mem::mgr::SandboxMemoryManager;
4142
use crate::mem::shared_mem::HostSharedMemory;
42-
use crate::{HyperlightError, Result, new_error};
4343
#[cfg(feature = "trace_guest")]
44-
use crate::{hypervisor::Hypervisor, sandbox::TraceInfo};
44+
use crate::sandbox::TraceInfo;
45+
use crate::{HyperlightError, Result, new_error};
4546

4647
#[instrument(err(Debug), skip_all, parent = Span::current(), level="Trace")]
4748
pub(super) fn outb_log(mgr: &mut SandboxMemoryManager<HostSharedMemory>) -> Result<()> {
@@ -267,7 +268,7 @@ pub(super) fn record_guest_trace_frame<F: FnOnce(&mut std::fs::File)>(
267268

268269
/// Handles OutB operations from the guest.
269270
#[instrument(err(Debug), skip_all, parent = Span::current(), level= "Trace")]
270-
fn handle_outb_impl(
271+
pub(crate) fn handle_outb(
271272
mem_mgr: &mut MemMgrWrapper<HostSharedMemory>,
272273
host_funcs: Arc<Mutex<FunctionRegistry>>,
273274
#[cfg(feature = "trace_guest")] _hv: &mut dyn Hypervisor,
@@ -402,31 +403,6 @@ fn handle_outb_impl(
402403
}
403404
}
404405
}
405-
406-
/// Given a `MemMgrWrapper` and ` HostFuncsWrapper` -- both passed by _value_
407-
/// -- return an `OutBHandlerWrapper` wrapping the core OUTB handler logic.
408-
///
409-
/// TODO: pass at least the `host_funcs_wrapper` param by reference.
410-
#[instrument(skip_all, parent = Span::current(), level= "Trace")]
411-
pub(crate) fn outb_handler_wrapper(
412-
mut mem_mgr_wrapper: MemMgrWrapper<HostSharedMemory>,
413-
host_funcs_wrapper: Arc<Mutex<FunctionRegistry>>,
414-
) -> OutBHandlerWrapper {
415-
let outb_func: OutBHandlerFunction =
416-
Box::new(move |#[cfg(feature = "trace_guest")] hv, port, payload| {
417-
handle_outb_impl(
418-
&mut mem_mgr_wrapper,
419-
host_funcs_wrapper.clone(),
420-
#[cfg(feature = "trace_guest")]
421-
hv,
422-
port,
423-
payload,
424-
)
425-
});
426-
let outb_hdl = OutBHandler::from(outb_func);
427-
Arc::new(Mutex::new(outb_hdl))
428-
}
429-
430406
#[cfg(test)]
431407
mod tests {
432408
use hyperlight_common::flatbuffer_wrappers::guest_log_level::LogLevel;

0 commit comments

Comments
 (0)