Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
8 changes: 6 additions & 2 deletions vhost-user-backend/src/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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 {
Expand Down
7 changes: 2 additions & 5 deletions vhost/src/vhost_user/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down Expand Up @@ -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)))
}

Expand Down Expand Up @@ -590,9 +589,7 @@ impl VhostUserMemoryRegion {
self.xen_mmap_data,
);

MmapRegion::<B>::from_range(range)
.map_err(MmapError::MmapRegion)
.map_err(|e| Error::ReqHandlerError(io::Error::other(e)))
MmapRegion::<B>::from_range(range).map_err(|e| Error::ReqHandlerError(io::Error::other(e)))
}

fn is_valid(&self) -> bool {
Expand Down