Trait vmcore::synic::SynicPortAccess

source ·
pub trait SynicPortAccess: Send + Sync {
    // Required methods
    fn add_message_port(
        &self,
        connection_id: u32,
        minimum_vtl: Vtl,
        port: Arc<dyn MessagePort>,
    ) -> Result<Box<dyn Sync + Send>, Error>;
    fn add_event_port(
        &self,
        connection_id: u32,
        minimum_vtl: Vtl,
        port: Arc<dyn EventPort>,
    ) -> Result<Box<dyn Sync + Send>, Error>;
    fn post_message(
        &self,
        vtl: Vtl,
        vp: u32,
        sint: u8,
        typ: u32,
        payload: &[u8],
    );
    fn new_guest_event_port(&self) -> Box<dyn GuestEventPort>;
    fn prefer_os_events(&self) -> bool;

    // Provided method
    fn monitor_support(&self) -> Option<&dyn SynicMonitorAccess> { ... }
}
Expand description

Trait for accessing partition’s synic ports.

Required Methods§

source

fn add_message_port( &self, connection_id: u32, minimum_vtl: Vtl, port: Arc<dyn MessagePort>, ) -> Result<Box<dyn Sync + Send>, Error>

Adds a host message port, which gets notified when the guest calls HvPostMessage.

source

fn add_event_port( &self, connection_id: u32, minimum_vtl: Vtl, port: Arc<dyn EventPort>, ) -> Result<Box<dyn Sync + Send>, Error>

Adds a host event port, which gets notified when the guest calls HvSignalEvent.

source

fn post_message(&self, vtl: Vtl, vp: u32, sint: u8, typ: u32, payload: &[u8])

Posts a message to the guest.

It is the caller’s responsibility to not queue too many messages. There is no backpressure mechanism at the transport layer.

FUTURE: add backpressure.

source

fn new_guest_event_port(&self) -> Box<dyn GuestEventPort>

Creates a GuestEventPort for signaling VMBus channels in the guest.

source

fn prefer_os_events(&self) -> bool

Returns whether callers should pass an OS event when creating event ports, as opposed to passing a function to call.

This is true when the hypervisor can more quickly dispatch an OS event and resume the VP than it can take an intercept into user mode and call a function.

Provided Methods§

source

fn monitor_support(&self) -> Option<&dyn SynicMonitorAccess>

Returns an object for manipulating the monitor page, or None if monitor pages aren’t supported.

Implementors§