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:
Demi Marie Obenour
2026-02-09 14:02:54 -05:00
committed by Rob Bradford
parent dde5f6ef38
commit 92b58ba94a
2 changed files with 4 additions and 5 deletions

View File

@@ -12440,6 +12440,7 @@ mod live_migration {
}
#[test]
#[ignore = "See #5532 and #7689"]
#[cfg(target_arch = "x86_64")]
#[cfg(not(feature = "mshv"))]
fn test_live_migration_ovs_dpdk_local() {

View File

@@ -375,15 +375,13 @@ 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()) };
}
// Remove socket path if needed
if self.server {
let _ = std::fs::remove_file(&self.socket_path);
}
// Drop the vhost-user handle
self.vu = None;
}
pub fn add_memory_region(