mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
virtio-devices: Do not close an unowned FD
Instead of closing a file descriptor that belongs to the vhost-user frontend, drop the vu_common_ctrl::VhostUserHandle and the vhost::vhost_user::Frontend it contains. This causes the destructor to drop the file descriptor. This breaks the last DPDK test, so disable it. See #7689. Fixes: #7163 Signed-off-by: Demi Marie Obenour <demiobenour@gmail.com>
This commit is contained in:
committed by
Rob Bradford
parent
dde5f6ef38
commit
92b58ba94a
@@ -12440,6 +12440,7 @@ mod live_migration {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
#[ignore = "See #5532 and #7689"]
|
||||||
#[cfg(target_arch = "x86_64")]
|
#[cfg(target_arch = "x86_64")]
|
||||||
#[cfg(not(feature = "mshv"))]
|
#[cfg(not(feature = "mshv"))]
|
||||||
fn test_live_migration_ovs_dpdk_local() {
|
fn test_live_migration_ovs_dpdk_local() {
|
||||||
|
|||||||
@@ -375,15 +375,13 @@ impl VhostUserCommon {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn shutdown(&mut self) {
|
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()) };
|
|
||||||
}
|
|
||||||
|
|
||||||
// Remove socket path if needed
|
// Remove socket path if needed
|
||||||
if self.server {
|
if self.server {
|
||||||
let _ = std::fs::remove_file(&self.socket_path);
|
let _ = std::fs::remove_file(&self.socket_path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Drop the vhost-user handle
|
||||||
|
self.vu = None;
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn add_memory_region(
|
pub fn add_memory_region(
|
||||||
|
|||||||
Reference in New Issue
Block a user