@@ -19,6 +19,7 @@ use std::sync::{Arc, Mutex};
1919use hyperlight_common:: flatbuffer_wrappers:: function_types:: ParameterValue ;
2020use hyperlight_common:: flatbuffer_wrappers:: guest_error:: ErrorCode ;
2121use hyperlight_common:: flatbuffer_wrappers:: guest_log_data:: GuestLogData ;
22+ use hyperlight_common:: outb:: OutBAction ;
2223use log:: { Level , Record } ;
2324use tracing:: { instrument, Span } ;
2425use tracing_log:: format_trace;
@@ -30,25 +31,6 @@ use crate::mem::mgr::SandboxMemoryManager;
3031use crate :: mem:: shared_mem:: HostSharedMemory ;
3132use crate :: { new_error, HyperlightError , Result } ;
3233
33- pub ( super ) enum OutBAction {
34- Log ,
35- CallFunction ,
36- Abort ,
37- }
38-
39- impl TryFrom < u16 > for OutBAction {
40- type Error = HyperlightError ;
41- #[ instrument( skip_all, parent = Span :: current( ) , level= "Trace" ) ]
42- fn try_from ( val : u16 ) -> Result < Self > {
43- match val {
44- 99 => Ok ( OutBAction :: Log ) ,
45- 101 => Ok ( OutBAction :: CallFunction ) ,
46- 102 => Ok ( OutBAction :: Abort ) ,
47- _ => Err ( new_error ! ( "Invalid OutB value: {}" , val) ) ,
48- }
49- }
50- }
51-
5234#[ instrument( err( Debug ) , skip_all, parent = Span :: current( ) , level="Trace" ) ]
5335pub ( super ) fn outb_log ( mgr : & mut SandboxMemoryManager < HostSharedMemory > ) -> Result < ( ) > {
5436 // This code will create either a logging record or a tracing record for the GuestLogData depending on if the host has set up a tracing subscriber.
0 commit comments