Skip to content

Commit e9c3095

Browse files
committed
build: Bump rust-vmm crates
The rust-vmm crates are out-of-date and has security problems, bump to catch up the security fixes. Signed-off-by: Ruoqing He <heruoqing@iscas.ac.cn>
1 parent 792678e commit e9c3095

File tree

2 files changed

+6
-56
lines changed

2 files changed

+6
-56
lines changed

Cargo.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ members = [
2424

2525
[workspace.dependencies]
2626
# rust-vmm crates
27-
vhost = "0.11.0"
28-
virtio-bindings = "=0.2.4"
29-
virtio-queue = "0.12.0"
30-
vm-memory = "0.14.1"
31-
vmm-sys-util = "0.12.1"
27+
vhost = "0.14.0"
28+
virtio-bindings = "0.2.6"
29+
virtio-queue = "0.16.0"
30+
vm-memory = "0.16.1"
31+
vmm-sys-util = "0.14.0"
3232

3333
[dependencies]
3434
arc-swap = "1.5"
@@ -65,7 +65,7 @@ vmm-sys-util = { workspace = true }
6565
vm-memory = { workspace = true, features = ["backend-mmap", "backend-bitmap"] }
6666

6767
[features]
68-
default = ["fusedev"]
68+
default = ["vhost-user-fs"]
6969
async-io = [
7070
"async-trait",
7171
"tokio-uring",

src/transport/fs_cache_req_handler.rs

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,7 @@ mod virtiofs {
1414
use std::io;
1515
use std::os::unix::io::RawFd;
1616

17-
#[cfg(feature = "vhost-user-fs")]
18-
use vhost::vhost_user::message::{
19-
VhostUserFSBackendMsg, VhostUserFSBackendMsgFlags, VHOST_USER_FS_BACKEND_ENTRIES,
20-
};
21-
#[cfg(feature = "vhost-user-fs")]
22-
use vhost::vhost_user::{Backend, VhostUserFrontendReqHandler};
23-
2417
use crate::abi::virtio_fs::RemovemappingOne;
25-
#[cfg(feature = "vhost-user-fs")]
26-
use crate::abi::virtio_fs::SetupmappingFlags;
2718

2819
/// Trait to support virtio-fs DAX Window operations.
2920
///
@@ -52,45 +43,4 @@ mod virtiofs {
5243
/// Remove those mappings that provide the access to file data.
5344
fn unmap(&mut self, requests: Vec<RemovemappingOne>) -> io::Result<()>;
5445
}
55-
56-
#[cfg(feature = "vhost-user-fs")]
57-
impl FsCacheReqHandler for Backend {
58-
fn map(
59-
&mut self,
60-
foffset: u64,
61-
moffset: u64,
62-
len: u64,
63-
flags: u64,
64-
fd: RawFd,
65-
) -> io::Result<()> {
66-
let mut msg: VhostUserFSBackendMsg = Default::default();
67-
msg.fd_offset[0] = foffset;
68-
msg.cache_offset[0] = moffset;
69-
msg.len[0] = len;
70-
msg.flags[0] = if (flags & SetupmappingFlags::WRITE.bits()) != 0 {
71-
VhostUserFSBackendMsgFlags::MAP_W | VhostUserFSBackendMsgFlags::MAP_R
72-
} else {
73-
VhostUserFSBackendMsgFlags::MAP_R
74-
};
75-
76-
self.fs_backend_map(&msg, &fd)?;
77-
78-
Ok(())
79-
}
80-
81-
fn unmap(&mut self, requests: Vec<RemovemappingOne>) -> io::Result<()> {
82-
for chunk in requests.chunks(VHOST_USER_FS_BACKEND_ENTRIES) {
83-
let mut msg: VhostUserFSBackendMsg = Default::default();
84-
85-
for (ind, req) in chunk.iter().enumerate() {
86-
msg.len[ind] = req.len;
87-
msg.cache_offset[ind] = req.moffset;
88-
}
89-
90-
self.fs_backend_unmap(&msg)?;
91-
}
92-
93-
Ok(())
94-
}
95-
}
9646
}

0 commit comments

Comments
 (0)