mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
virtio-devices: modify or provide safety comments
Signed-off-by: Wei Liu <liuwe@microsoft.com>
This commit is contained in:
@@ -375,6 +375,7 @@ impl VhostUserCommon {
|
||||
|
||||
pub fn shutdown(&mut self) {
|
||||
if let Some(vu) = &self.vu {
|
||||
// SAFETY: trivially safe
|
||||
let _ = unsafe { libc::close(vu.lock().unwrap().socket_handle().as_raw_fd()) };
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user