Skip to content

Commit e869735

Browse files
uran0sHstefano-garzarella
authored andcommitted
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 <[email protected]>
1 parent 580f19f commit e869735

File tree

2 files changed

+21
-8
lines changed

2 files changed

+21
-8
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ members = [
1010
virtio-bindings = "0.2.6"
1111
virtio-queue = "0.16.0"
1212
vm-memory = "0.16.2"
13-
vmm-sys-util = "0.14.0"
13+
vmm-sys-util = "0.15.0"

vhost/src/vhost_user/connection.rs

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -760,9 +760,13 @@ mod tests {
760760
.unwrap();
761761
assert_eq!(len, 4);
762762

763-
let (bytes, buf4) = backend.recv_data(2).unwrap();
764-
assert_eq!(bytes, 2);
765-
assert_eq!(&buf1[..2], &buf4[..]);
763+
if cfg!(any(target_os = "linux", target_os = "android")) {
764+
let _err = backend.recv_data(2).unwrap_err();
765+
} else {
766+
let (bytes, buf4) = backend.recv_data(2).unwrap();
767+
assert_eq!(bytes, 2);
768+
assert_eq!(&buf1[..2], &buf4[..]);
769+
}
766770
let (bytes, buf2, files) = backend.recv_into_buf(0x2).unwrap();
767771
assert_eq!(bytes, 2);
768772
assert_eq!(&buf1[2..], &buf2[..]);
@@ -817,12 +821,21 @@ mod tests {
817821
.unwrap();
818822
assert_eq!(len, 4);
819823

820-
let (bytes, _) = backend.recv_data(5).unwrap();
821-
assert_eq!(bytes, 5);
824+
if cfg!(any(target_os = "linux", target_os = "android")) {
825+
let _err = backend.recv_data(5).unwrap_err();
826+
} else {
827+
let (bytes, _) = backend.recv_data(5).unwrap();
828+
assert_eq!(bytes, 4);
829+
}
822830

823831
let (bytes, _, files) = backend.recv_into_buf(0x4).unwrap();
824-
assert_eq!(bytes, 3);
825-
assert!(files.is_none());
832+
if cfg!(any(target_os = "linux", target_os = "android")) {
833+
assert_eq!(bytes, 3);
834+
assert!(files.is_none());
835+
} else {
836+
assert_eq!(bytes, 4);
837+
assert!(files.is_some());
838+
}
826839

827840
// If the target fd array is too small, extra file descriptors will get lost.
828841
let len = frontend

0 commit comments

Comments
 (0)