vmbus_server

Struct VmbusServerBuilder

Source
pub struct VmbusServerBuilder<'a, T: Spawn> { /* private fields */ }

Implementations§

Source§

impl<'a, T: Spawn> VmbusServerBuilder<'a, T>

Source

pub fn new( spawner: &'a T, synic: Arc<dyn SynicPortAccess>, gm: GuestMemory, ) -> Self

Creates a new builder for VmbusServer with the default options.

Source

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.

Source

pub fn vtl(self, vtl: Vtl) -> Self

Sets the VTL that this instance will serve.

Source

pub fn hvsock_notify( self, hvsock_notify: Option<HvsockServerChannelHalf>, ) -> Self

Sets a send/receive pair used to handle hvsocket requests.

Source

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.

Source

pub fn external_requests( self, external_requests: Option<Receiver<InitiateContactRequest>>, ) -> Self

Sets a receiver that receives requests from another server.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Auto Trait Implementations§

§

impl<'a, T> Freeze for VmbusServerBuilder<'a, T>

§

impl<'a, T> !RefUnwindSafe for VmbusServerBuilder<'a, T>

§

impl<'a, T> Send for VmbusServerBuilder<'a, T>

§

impl<'a, T> Sync for VmbusServerBuilder<'a, T>

§

impl<'a, T> Unpin for VmbusServerBuilder<'a, T>

§

impl<'a, T> !UnwindSafe for VmbusServerBuilder<'a, T>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> IntoAny for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Converts into a Box<dyn Any>.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more