summary refs log tree commit diff
path: root/vhost
diff options
context:
space:
mode:
authorDavid Tolnay <dtolnay@chromium.org>2018-12-14 13:46:48 -0800
committerchrome-bot <chrome-bot@chromium.org>2018-12-18 00:42:52 -0800
commit1dda82e8b288f538145abe15fbd42606edfc5c2a (patch)
tree21c2ce10c453b5948b0b660904d0c1981d19cc13 /vhost
parent63bc050f5a160fa98e588c4850d82d49d7c3518d (diff)
downloadcrosvm-1dda82e8b288f538145abe15fbd42606edfc5c2a.tar
crosvm-1dda82e8b288f538145abe15fbd42606edfc5c2a.tar.gz
crosvm-1dda82e8b288f538145abe15fbd42606edfc5c2a.tar.bz2
crosvm-1dda82e8b288f538145abe15fbd42606edfc5c2a.tar.lz
crosvm-1dda82e8b288f538145abe15fbd42606edfc5c2a.tar.xz
crosvm-1dda82e8b288f538145abe15fbd42606edfc5c2a.tar.zst
crosvm-1dda82e8b288f538145abe15fbd42606edfc5c2a.zip
sys_util: Combine GuestMemory::with_regions and with_regions_mut
Every implementation of Fn also implements FnMut, so if some callback
can be passed to GuestMemory::with_regions then it could also have been
passed to GuestMemory::with_regions_mut.

This CL removes GuestMemory::with_regions and renames with_regions_mut
to with_regions.

TEST=cargo check

Change-Id: Ia4f168ff4eb4d45a5ee8f9413821ae244fb72ee1
Reviewed-on: https://chromium-review.googlesource.com/1378688
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: David Tolnay <dtolnay@chromium.org>
Reviewed-by: Stephen Barber <smbarber@chromium.org>
Diffstat (limited to 'vhost')
-rw-r--r--vhost/src/lib.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/vhost/src/lib.rs b/vhost/src/lib.rs
index 96a3421..552f546 100644
--- a/vhost/src/lib.rs
+++ b/vhost/src/lib.rs
@@ -111,7 +111,7 @@ pub trait Vhost: AsRawFd + std::marker::Sized {
 
         let _ = self
             .mem()
-            .with_regions_mut::<_, ()>(|index, guest_addr, size, host_addr| {
+            .with_regions::<_, ()>(|index, guest_addr, size, host_addr| {
                 vhost_regions[index] = virtio_sys::vhost_memory_region {
                     guest_phys_addr: guest_addr.offset() as u64,
                     memory_size: size as u64,