pub struct VmbusServerBuilder<'a, T: Spawn> { /* private fields */ }
Implementations§
Source§impl<'a, T: Spawn> VmbusServerBuilder<'a, T>
impl<'a, T: Spawn> VmbusServerBuilder<'a, T>
Sourcepub fn new(
spawner: &'a T,
synic: Arc<dyn SynicPortAccess>,
gm: GuestMemory,
) -> Self
pub fn new( spawner: &'a T, synic: Arc<dyn SynicPortAccess>, gm: GuestMemory, ) -> Self
Creates a new builder for VmbusServer
with the default options.
Sourcepub fn private_gm(self, private_gm: Option<GuestMemory>) -> Self
pub fn private_gm(self, private_gm: Option<GuestMemory>) -> Self
Sets a separate guest memory instance to use for channels that are confidential (non-relay channels in Underhill on a hardware isolated VM). This is not relevant for a non-Underhill VmBus server.
Sourcepub fn hvsock_notify(
self,
hvsock_notify: Option<HvsockServerChannelHalf>,
) -> Self
pub fn hvsock_notify( self, hvsock_notify: Option<HvsockServerChannelHalf>, ) -> Self
Sets a send/receive pair used to handle hvsocket requests.
Sourcepub fn server_relay(self, server_relay: Option<VmbusServerChannelHalf>) -> Self
pub fn server_relay(self, server_relay: Option<VmbusServerChannelHalf>) -> Self
Sets a send/receive pair that will be notified of server requests. This is used by the Underhill relay.
Sourcepub fn external_requests(
self,
external_requests: Option<Receiver<InitiateContactRequest>>,
) -> Self
pub fn external_requests( self, external_requests: Option<Receiver<InitiateContactRequest>>, ) -> Self
Sets a receiver that receives requests from another server.
Sourcepub fn external_server(
self,
external_server: Option<Sender<InitiateContactRequest>>,
) -> Self
pub fn external_server( self, external_server: Option<Sender<InitiateContactRequest>>, ) -> Self
Sets a sender used to forward unhandled connect requests (which used a different VTL) to another server.
Sourcepub fn use_message_redirect(self, use_message_redirect: bool) -> Self
pub fn use_message_redirect(self, use_message_redirect: bool) -> Self
Sets a value which indicates whether the vmbus control plane is redirected to Underhill.
Sourcepub fn enable_channel_id_offset(self, enable: bool) -> Self
pub fn enable_channel_id_offset(self, enable: bool) -> Self
Tells the server to use an offset when generating channel IDs to void collisions with another vmbus server.
N.B. This should only be used by the Underhill vmbus server.
Sourcepub fn max_version(self, max_version: Option<MaxVersionInfo>) -> Self
pub fn max_version(self, max_version: Option<MaxVersionInfo>) -> Self
Tells the server to limit the protocol version offered to the guest.
N.B. This is used for testing older protocols without requiring a specific guest OS.
Sourcepub fn delay_max_version(self, delay: bool) -> Self
pub fn delay_max_version(self, delay: bool) -> Self
Delay limiting the maximum version until after the first Unload
message.
N.B. This is used to enable the use of versions older than Version::Win10
with Uefi boot,
since that’s the oldest version the Uefi client supports.
Sourcepub fn enable_mnf(self, enable: bool) -> Self
pub fn enable_mnf(self, enable: bool) -> Self
Enable MNF support in the server.
N.B. Enabling this has no effect if the synic does not support mapping monitor pages.
Sourcepub fn force_confidential_external_memory(self, force: bool) -> Self
pub fn force_confidential_external_memory(self, force: bool) -> Self
Force all non-relay channels to use encrypted external memory. Used for testing purposes only.
Sourcepub fn send_messages_while_stopped(self, send: bool) -> Self
pub fn send_messages_while_stopped(self, send: bool) -> Self
Send messages to the partition even while stopped, which can cause corrupted synic states across VM reset.
This option is used to prevent messages from getting into the queue, for saved state compatibility with release/2411. It can be removed once that release is no longer supported.
Sourcepub fn build(self) -> Result<VmbusServer>
pub fn build(self) -> Result<VmbusServer>
Creates a new instance of the server.
When the object is dropped, all channels will be closed and revoked automatically.