From 173fe62df2b82f4d09a36066200f0a1727bd1d22 Mon Sep 17 00:00:00 2001 From: Gurchetan Singh Date: Thu, 21 May 2020 18:05:06 -0700 Subject: kvm: use MappedRegion trait - Reduces code duplication between MMIO and mmap arenas - Makes adding future types easier - Makes upcoming deprecation of kvm crate easier - Use BTreeMap instead of HashMap since it's more efficient BUG=chromium:924405 TEST=compile and test Change-Id: I520abed0926489e64aac046e0dc0cfeb72fae7b2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2216446 Tested-by: Gurchetan Singh Tested-by: kokoro Commit-Queue: Gurchetan Singh Reviewed-by: Steven Richman Reviewed-by: Daniel Verkamp Auto-Submit: Gurchetan Singh --- src/linux.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/linux.rs') diff --git a/src/linux.rs b/src/linux.rs index fb463c2..687aae4 100644 --- a/src/linux.rs +++ b/src/linux.rs @@ -1012,9 +1012,9 @@ fn create_pmem_device( .map_err(Error::AllocatePmemDeviceAddress)?; let slot = vm - .add_mmap_arena( + .add_memory_region( GuestAddress(mapping_address), - arena, + Box::new(arena), /* read_only = */ disk.read_only, /* log_dirty_pages = */ false, ) -- cgit 1.4.1