mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2025-02-21 19:02:30 +00:00
vm-virtio: vhost_user: net: On shutdown() drop the socket
This causes the vhost-user-net backend to shutdown. Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
parent
7c9e8b103f
commit
503887843f
@ -17,6 +17,7 @@ use libc::EFD_NONBLOCK;
|
||||
use net_util::MacAddr;
|
||||
use std::cmp;
|
||||
use std::io::Write;
|
||||
use std::os::unix::io::AsRawFd;
|
||||
use std::result;
|
||||
use std::sync::atomic::{AtomicBool, Ordering};
|
||||
use std::sync::Arc;
|
||||
@ -354,6 +355,10 @@ impl VirtioDevice for Net {
|
||||
self.queue_evts.take().unwrap(),
|
||||
))
|
||||
}
|
||||
|
||||
fn shutdown(&mut self) {
|
||||
let _ = unsafe { libc::close(self.vhost_user_net.as_raw_fd()) };
|
||||
}
|
||||
}
|
||||
|
||||
virtio_ctrl_q_pausable!(Net);
|
||||
|
Loading…
x
Reference in New Issue
Block a user