diff options
-rw-r--r-- | devices/src/virtio/vhost/net.rs | 7 | ||||
-rw-r--r-- | devices/src/virtio/vhost/vsock.rs | 1 | ||||
-rw-r--r-- | devices/src/virtio/vhost/worker.rs | 4 |
3 files changed, 12 insertions, 0 deletions
diff --git a/devices/src/virtio/vhost/net.rs b/devices/src/virtio/vhost/net.rs index 21f1587..cc9521a 100644 --- a/devices/src/virtio/vhost/net.rs +++ b/devices/src/virtio/vhost/net.rs @@ -204,6 +204,11 @@ where if let Some(vhost_interrupt) = self.vhost_interrupt.take() { if let Some(kill_evt) = self.workers_kill_evt.take() { let acked_features = self.acked_features; + let socket = if self.response_socket.is_some() { + self.response_socket.take() + } else { + None + }; let worker_result = thread::Builder::new() .name("vhost_net".to_string()) .spawn(move || { @@ -214,6 +219,7 @@ where interrupt, acked_features, kill_evt, + socket, ); let activate_vqs = |handle: &U| -> Result<()> { for idx in 0..NUM_QUEUES { @@ -284,6 +290,7 @@ where self.tap = Some(tap); self.vhost_interrupt = Some(worker.vhost_interrupt); self.workers_kill_evt = Some(worker.kill_evt); + self.response_socket = worker.response_socket; return true; } } diff --git a/devices/src/virtio/vhost/vsock.rs b/devices/src/virtio/vhost/vsock.rs index 03826ff..390c857 100644 --- a/devices/src/virtio/vhost/vsock.rs +++ b/devices/src/virtio/vhost/vsock.rs @@ -169,6 +169,7 @@ impl VirtioDevice for Vsock { interrupt, acked_features, kill_evt, + None, ); let activate_vqs = |handle: &VhostVsockHandle| -> Result<()> { handle.set_cid(cid).map_err(Error::VhostVsockSetCid)?; diff --git a/devices/src/virtio/vhost/worker.rs b/devices/src/virtio/vhost/worker.rs index 1eff01f..03c1066 100644 --- a/devices/src/virtio/vhost/worker.rs +++ b/devices/src/virtio/vhost/worker.rs @@ -7,6 +7,7 @@ use std::os::raw::c_ulonglong; use sys_util::{EventFd, PollContext, PollToken}; use vhost::Vhost; +use super::control_socket::VhostDevResponseSocket; use super::{Error, Result}; use crate::virtio::{Interrupt, Queue}; @@ -21,6 +22,7 @@ pub struct Worker<T: Vhost> { pub vhost_interrupt: Vec<EventFd>, acked_features: u64, pub kill_evt: EventFd, + pub response_socket: Option<VhostDevResponseSocket>, } impl<T: Vhost> Worker<T> { @@ -31,6 +33,7 @@ impl<T: Vhost> Worker<T> { interrupt: Interrupt, acked_features: u64, kill_evt: EventFd, + response_socket: Option<VhostDevResponseSocket>, ) -> Worker<T> { Worker { interrupt, @@ -39,6 +42,7 @@ impl<T: Vhost> Worker<T> { vhost_interrupt, acked_features, kill_evt, + response_socket, } } |