pub struct ServerWithNotifier<'a, T> { /* private fields */ }
Implementations§
Source§impl<'a, N: 'a + Notifier> ServerWithNotifier<'a, N>
impl<'a, N: 'a + Notifier> ServerWithNotifier<'a, N>
Sourcepub fn restore(&mut self, saved: SavedState) -> Result<(), RestoreError>
pub fn restore(&mut self, saved: SavedState) -> Result<(), RestoreError>
Restores state.
This may be called before or after channels have been offered. After
calling this routine, restore_channel
should be
called for each channel to be restored, possibly interleaved with
additional calls to offer or revoke channels.
Once all channels are in the appropriate state,
revoke_unclaimed_channels
should be called. This will revoke
any channels that were in the saved state but were not restored via
restore_channel
.
Source§impl<'a, N: 'a + Notifier> ServerWithNotifier<'a, N>
impl<'a, N: 'a + Notifier> ServerWithNotifier<'a, N>
Sourcepub fn restore_channel(
&mut self,
offer_id: OfferId,
open: bool,
) -> Result<(), RestoreError>
pub fn restore_channel( &mut self, offer_id: OfferId, open: bool, ) -> Result<(), RestoreError>
Marks a channel as restored.
If this is not called for a channel but vmbus state is restored, then it is assumed that the offer is a fresh one, and the channel will be revoked and reoffered.
Sourcepub fn revoke_unclaimed_channels(&mut self)
pub fn revoke_unclaimed_channels(&mut self)
Revoke and reoffer channels to the guest, depending on their RestoreState.
This function should be called after ServerWithNotifier::restore
.
Sourcepub fn reset(&mut self)
pub fn reset(&mut self)
Initiates a state reset and a closing of all channels.
Only one reset is allowed at a time, and no calls to
handle_synic_message
are allowed during a reset operation.
Sourcepub fn offer_channel(
&mut self,
offer: OfferParamsInternal,
) -> Result<OfferId, OfferError>
pub fn offer_channel( &mut self, offer: OfferParamsInternal, ) -> Result<OfferId, OfferError>
Creates a new channel, returning its channel ID.
Sourcepub fn revoke_channel(&mut self, offer_id: OfferId)
pub fn revoke_channel(&mut self, offer_id: OfferId)
Revokes a channel by ID.
Sourcepub fn open_complete(&mut self, offer_id: OfferId, result: i32)
pub fn open_complete(&mut self, offer_id: OfferId, result: i32)
Completes an open operation with result
.
Sourcepub fn close_complete(&mut self, offer_id: OfferId)
pub fn close_complete(&mut self, offer_id: OfferId)
Completes a channel close operation.
pub fn initiate_contact(&mut self, request: InitiateContactRequest)
Sourcepub fn send_tl_connect_result(&mut self, result: HvsockConnectResult)
pub fn send_tl_connect_result(&mut self, result: HvsockConnectResult)
Sends a message to the guest if an hvsocket connect request failed.
Sourcepub fn modify_channel_complete(&mut self, offer_id: OfferId, status: i32)
pub fn modify_channel_complete(&mut self, offer_id: OfferId, status: i32)
Complete the ModifyChannel message.
N.B. The guest expects no further interrupts on the old VP at this point. This is guaranteed because notify() handles updating the event port synchronously before, notifying the device/relay, and all types of event port protect their VP settings with locks.
pub fn complete_modify_connection(&mut self, response: ModifyConnectionResponse)
Sourcepub fn handle_synic_message(
&mut self,
message: SynicMessage,
) -> Result<(), ChannelError>
pub fn handle_synic_message( &mut self, message: SynicMessage, ) -> Result<(), ChannelError>
Processes an incoming message from the guest.
Sourcepub fn gpadl_create_complete(
&mut self,
offer_id: OfferId,
gpadl_id: GpadlId,
status: i32,
)
pub fn gpadl_create_complete( &mut self, offer_id: OfferId, gpadl_id: GpadlId, status: i32, )
Completes a GPADL creation, accepting it if status >= 0
, rejecting it otherwise.
Sourcepub fn gpadl_teardown_complete(&mut self, offer_id: OfferId, gpadl_id: GpadlId)
pub fn gpadl_teardown_complete(&mut self, offer_id: OfferId, gpadl_id: GpadlId)
Releases a GPADL that is being torn down.