diff --git a/Cargo.toml b/Cargo.toml index 26aa1564..5dba6e64 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,6 +8,6 @@ members = [ [workspace.dependencies] virtio-bindings = "0.2.6" -virtio-queue = "0.16.0" -vm-memory = "0.16.2" +virtio-queue = "0.17.0" +vm-memory = "0.17.1" vmm-sys-util = "0.15.0" diff --git a/vhost-user-backend/src/handler.rs b/vhost-user-backend/src/handler.rs index 33008756..685ab67b 100644 --- a/vhost-user-backend/src/handler.rs +++ b/vhost-user-backend/src/handler.rs @@ -318,7 +318,9 @@ where region.mmap_region(file)?, GuestAddress(region.guest_phys_addr), ) - .map_err(|e| VhostUserError::ReqHandlerError(io::Error::other(e)))?; + .ok_or(VhostUserError::ReqHandlerError( + io::ErrorKind::InvalidInput.into(), + ))?; mappings.push(AddrMapping { #[cfg(feature = "postcopy")] local_addr: guest_region.as_ptr() as u64, @@ -606,7 +608,9 @@ where region.mmap_region(file)?, GuestAddress(region.guest_phys_addr), ) - .map_err(|e| VhostUserError::ReqHandlerError(io::Error::other(e)))?, + .ok_or(VhostUserError::ReqHandlerError( + io::ErrorKind::InvalidInput.into(), + ))?, ); let addr_mapping = AddrMapping { diff --git a/vhost/src/vhost_user/message.rs b/vhost/src/vhost_user/message.rs index 7fd93ce7..eef2c67d 100644 --- a/vhost/src/vhost_user/message.rs +++ b/vhost/src/vhost_user/message.rs @@ -17,7 +17,7 @@ use std::ops::Deref; use uuid::Uuid; -use vm_memory::{mmap::NewBitmap, ByteValued, Error as MmapError, FileOffset, MmapRegion}; +use vm_memory::{mmap::NewBitmap, ByteValued, FileOffset, MmapRegion}; #[cfg(feature = "xen")] use vm_memory::{GuestAddress, MmapRange, MmapXenFlags}; @@ -550,7 +550,6 @@ impl VhostUserMemoryRegion { FileOffset::new(file, self.mmap_offset), self.memory_size as usize, ) - .map_err(MmapError::MmapRegion) .map_err(|e| Error::ReqHandlerError(io::Error::other(e))) } @@ -590,9 +589,7 @@ impl VhostUserMemoryRegion { self.xen_mmap_data, ); - MmapRegion::::from_range(range) - .map_err(MmapError::MmapRegion) - .map_err(|e| Error::ReqHandlerError(io::Error::other(e))) + MmapRegion::::from_range(range).map_err(|e| Error::ReqHandlerError(io::Error::other(e))) } fn is_valid(&self) -> bool {