From e869735f3fa7429da680735882cb6e4d0b0cb8de Mon Sep 17 00:00:00 2001 From: Wenyu Huang Date: Wed, 9 Jul 2025 16:20:44 +0000 Subject: [PATCH] chore: update the vmm-sys-util version Update to v0.15.0 which supports sock_ctrl_msg on POSIX and adds a cross platform event notification that uses EventFd when available or pipe(). Because sock_ctrl_msg modifies the recv_with_fds, we need to modify the test in vhost/src/vhost-user/connection.rs at the same time Signed-off-by: Wenyu Huang --- Cargo.toml | 2 +- vhost/src/vhost_user/connection.rs | 27 ++++++++++++++++++++------- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 6740398..26aa156 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,4 +10,4 @@ members = [ virtio-bindings = "0.2.6" virtio-queue = "0.16.0" vm-memory = "0.16.2" -vmm-sys-util = "0.14.0" +vmm-sys-util = "0.15.0" diff --git a/vhost/src/vhost_user/connection.rs b/vhost/src/vhost_user/connection.rs index 3485e78..c0b289b 100644 --- a/vhost/src/vhost_user/connection.rs +++ b/vhost/src/vhost_user/connection.rs @@ -760,9 +760,13 @@ mod tests { .unwrap(); assert_eq!(len, 4); - let (bytes, buf4) = backend.recv_data(2).unwrap(); - assert_eq!(bytes, 2); - assert_eq!(&buf1[..2], &buf4[..]); + if cfg!(any(target_os = "linux", target_os = "android")) { + let _err = backend.recv_data(2).unwrap_err(); + } else { + let (bytes, buf4) = backend.recv_data(2).unwrap(); + assert_eq!(bytes, 2); + assert_eq!(&buf1[..2], &buf4[..]); + } let (bytes, buf2, files) = backend.recv_into_buf(0x2).unwrap(); assert_eq!(bytes, 2); assert_eq!(&buf1[2..], &buf2[..]); @@ -817,12 +821,21 @@ mod tests { .unwrap(); assert_eq!(len, 4); - let (bytes, _) = backend.recv_data(5).unwrap(); - assert_eq!(bytes, 5); + if cfg!(any(target_os = "linux", target_os = "android")) { + let _err = backend.recv_data(5).unwrap_err(); + } else { + let (bytes, _) = backend.recv_data(5).unwrap(); + assert_eq!(bytes, 4); + } let (bytes, _, files) = backend.recv_into_buf(0x4).unwrap(); - assert_eq!(bytes, 3); - assert!(files.is_none()); + if cfg!(any(target_os = "linux", target_os = "android")) { + assert_eq!(bytes, 3); + assert!(files.is_none()); + } else { + assert_eq!(bytes, 4); + assert!(files.is_some()); + } // If the target fd array is too small, extra file descriptors will get lost. let len = frontend