Skip to content

Commit

Permalink
chore: Update vm-memory to 0.12.2
Browse files Browse the repository at this point in the history
To solve a cargo audit on vm-memory<=0.12.1

Signed-off-by: Patrick Roy <[email protected]>
  • Loading branch information
roypat committed Sep 8, 2023
1 parent 59e3d08 commit 270bd27
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 9 deletions.
9 changes: 5 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ thiserror = "1.0.32"
versionize = "0.1.10"
versionize_derive = "0.1.5"
vmm-sys-util = "0.11.0"
vm-memory = { version = "0.10.0", features = ["backend-mmap", "backend-bitmap"] }
vm-memory = { version = "0.12.2", features = ["backend-mmap", "backend-bitmap"] }

net_gen = { path = "../net_gen" }

Expand Down
2 changes: 1 addition & 1 deletion src/vmm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ kvm-bindings = { version = "0.6.0", features = ["fam-wrappers"] }
kvm-ioctls = "0.12.0"
lazy_static = "1.4.0"
libc = "0.2.117"
linux-loader = "0.8.1"
linux-loader = "0.9.1"
log = "0.4.17"
rand = "0.8.5"
serde = { version = "1.0.185", features = ["derive"] }
Expand Down
4 changes: 2 additions & 2 deletions src/vmm/src/devices/virtio/block/io/async_io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ impl<T> AsyncFileEngine<T> {
user_data: T,
) -> Result<(), UserDataError<T, Error>> {
let buf = match mem.get_slice(addr, count as usize) {
Ok(slice) => slice.as_ptr(),
Ok(slice) => slice.ptr_guard_mut().as_ptr(),
Err(err) => {
return Err(UserDataError {
user_data,
Expand Down Expand Up @@ -144,7 +144,7 @@ impl<T> AsyncFileEngine<T> {
user_data: T,
) -> Result<(), UserDataError<T, Error>> {
let buf = match mem.get_slice(addr, count as usize) {
Ok(slice) => slice.as_ptr(),
Ok(slice) => slice.ptr_guard_mut().as_ptr(),
Err(err) => {
return Err(UserDataError {
user_data,
Expand Down
3 changes: 2 additions & 1 deletion src/vmm/src/devices/virtio/iovec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ impl IoVecBuffer {
// region in the GuestMemoryMmap.
let iov_base = mem
.get_slice(desc.addr, desc.len as usize)?
.ptr_guard_mut()
.as_ptr()
.cast::<c_void>();
vecs.push(iovec {
Expand Down Expand Up @@ -245,7 +246,7 @@ impl IoVecBufferMut {
// vm-memory related information after converting down to iovecs.
slice.bitmap().mark_dirty(0, desc.len as usize);

let iov_base = slice.as_ptr().cast::<c_void>();
let iov_base = slice.ptr_guard_mut().as_ptr().cast::<c_void>();
vecs.push(iovec {
iov_base,
iov_len: desc.len as size_t,
Expand Down

0 comments on commit 270bd27

Please sign in to comment.