Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions lib/propolis/src/hw/virtio/vsock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,15 @@ impl VsockVq {

Some(packet)
}

/// Drop any cached descriptor chain.
///
/// This MUST be called when reseting the virtio-socket device so
/// that we don't use stale `GuestAddr`s across device resets.
#[cfg(target_os = "illumos")]
pub(crate) fn clear_rx_chain(&mut self) {
self.rx_chain = None;
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the future I would like to eliminate this RxPermit by possibly extending the VirtQueue to allow peek() or a method that checks if the chain has a descriptor available.

}
}

pub struct PciVirtioSock {
Expand Down Expand Up @@ -253,8 +262,19 @@ impl Lifecycle for PciVirtioSock {
fn type_name(&self) -> &'static str {
"pci-virtio-socket"
}
fn pause(&self) {
let _ = self.backend.pause();
self.backend.wait_stopped();
}
fn reset(&self) {
self.virtio_state.reset(self);
self.backend.reset();
}
fn resume(&self) {
self.backend.resume();
}
fn halt(&self) {
self.backend.halt();
}
fn migrate(&'_ self) -> Migrator<'_> {
// TODO (MTZ):
Expand Down
Loading
Loading