Skip to content

Commit 3574bca

Browse files
committed
[hyperlight_host] Restrict OutBHandler{Caller,Wrapper} to pub(crate)
In the future, the outb handler will need to take a Hypervisor instance in order to be able to access register and memory state of the VM, so it doesn't make sense for these interfaces to be more public than the `Hypervisor` trait. Nobody outside of Hyperlight seems to use these at the moment, so it's probably simplest to restrict these to `pub(crate)`. Signed-off-by: Lucy Menon <168595099+syntactically@users.noreply.github.com>
1 parent 0bc6ec4 commit 3574bca

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/hyperlight_host/src/hypervisor/handlers.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ use crate::{new_error, Result};
2323
/// The trait representing custom logic to handle the case when
2424
/// a Hypervisor's virtual CPU (vCPU) informs Hyperlight the guest
2525
/// has initiated an outb operation.
26-
pub trait OutBHandlerCaller: Sync + Send {
26+
pub(crate) trait OutBHandlerCaller: Sync + Send {
2727
/// Function that gets called when an outb operation has occurred.
2828
fn call(&mut self, port: u16, payload: u64) -> Result<()>;
2929
}
@@ -34,7 +34,7 @@ pub trait OutBHandlerCaller: Sync + Send {
3434
/// Note: This needs to be wrapped in a Mutex to be able to grab a mutable
3535
/// reference to the underlying data (i.e., handle_outb in `Sandbox` takes
3636
/// a &mut self).
37-
pub type OutBHandlerWrapper = Arc<Mutex<dyn OutBHandlerCaller>>;
37+
pub(crate) type OutBHandlerWrapper = Arc<Mutex<dyn OutBHandlerCaller>>;
3838

3939
pub(crate) type OutBHandlerFunction = Box<dyn FnMut(u16, u64) -> Result<()> + Send>;
4040

0 commit comments

Comments
 (0)