mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-08-22 07:51:16 +00:00
vm-virtio: vhost_user: block: On shutdown() drop the socket
This causes the vhost-user-block backend to shutdown. Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
parent
7fabca3548
commit
4d60ef59bc
@ -14,6 +14,7 @@ use libc::EFD_NONBLOCK;
|
|||||||
use std::cmp;
|
use std::cmp;
|
||||||
use std::io::Write;
|
use std::io::Write;
|
||||||
use std::mem;
|
use std::mem;
|
||||||
|
use std::os::unix::io::AsRawFd;
|
||||||
use std::result;
|
use std::result;
|
||||||
use std::sync::atomic::{AtomicBool, Ordering};
|
use std::sync::atomic::{AtomicBool, Ordering};
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
@ -314,6 +315,10 @@ impl VirtioDevice for Blk {
|
|||||||
self.queue_evts.take().unwrap(),
|
self.queue_evts.take().unwrap(),
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn shutdown(&mut self) {
|
||||||
|
let _ = unsafe { libc::close(self.vhost_user_blk.as_raw_fd()) };
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
virtio_pausable!(Blk);
|
virtio_pausable!(Blk);
|
||||||
|
Loading…
Reference in New Issue
Block a user