@@ -143,7 +143,7 @@ impl MmapRange {
143143/// physical memory may be mapped into the current process due to the limited virtual address
144144/// space size of the process.
145145#[ derive( Debug ) ]
146- pub struct MmapRegion < B = ( ) > {
146+ pub struct GuestRegionXen < B = ( ) > {
147147 bitmap : B ,
148148 size : usize ,
149149 prot : i32 ,
@@ -153,7 +153,7 @@ pub struct MmapRegion<B = ()> {
153153 mmap : MmapXen ,
154154}
155155
156- impl < B : Bitmap > GuestMemoryRegion for MmapRegion < B > {
156+ impl < B : Bitmap > GuestMemoryRegion for GuestRegionXen < B > {
157157 type B = B ;
158158
159159 fn len ( & self ) -> GuestUsize {
@@ -195,23 +195,23 @@ impl<B: Bitmap> GuestMemoryRegion for MmapRegion<B> {
195195 }
196196}
197197
198- impl < B : Bitmap > GuestMemoryRegionBytes for MmapRegion < B > { }
198+ impl < B : Bitmap > GuestMemoryRegionBytes for GuestRegionXen < B > { }
199199
200200/// A collection of Xen guest memory regions.
201201///
202202/// Represents the entire physical memory of the guest by tracking all its memory regions.
203- /// Each region is an instance of [`MmapRegionXen `].
204- pub type GuestMemoryXen < B > = GuestRegionCollection < MmapRegion < B > > ;
203+ /// Each region is an instance of [`GuestRegionXen `].
204+ pub type GuestMemoryXen < B > = GuestRegionCollection < GuestRegionXen < B > > ;
205205
206206// SAFETY: Send and Sync aren't automatically inherited for the raw address pointer.
207207// Accessing that pointer is only done through the stateless interface which
208208// allows the object to be shared by multiple threads without a decrease in
209209// safety.
210- unsafe impl < B : Send > Send for MmapRegion < B > { }
210+ unsafe impl < B : Send > Send for GuestRegionXen < B > { }
211211// SAFETY: See comment above.
212- unsafe impl < B : Sync > Sync for MmapRegion < B > { }
212+ unsafe impl < B : Sync > Sync for GuestRegionXen < B > { }
213213
214- impl < B : NewBitmap > MmapRegion < B > {
214+ impl < B : NewBitmap > GuestRegionXen < B > {
215215 /// Creates a shared anonymous mapping of `size` bytes.
216216 ///
217217 /// # Arguments
@@ -297,7 +297,7 @@ impl<B: NewBitmap> MmapRegion<B> {
297297
298298 let mmap = MmapXen :: new ( & range) ?;
299299
300- Ok ( MmapRegion {
300+ Ok ( GuestRegionXen {
301301 bitmap : B :: with_len ( range. size ) ,
302302 size : range. size ,
303303 prot : range. prot . ok_or ( Error :: Unexpected ) ?,
@@ -309,7 +309,7 @@ impl<B: NewBitmap> MmapRegion<B> {
309309 }
310310}
311311
312- impl < B : Bitmap > MmapRegion < B > {
312+ impl < B : Bitmap > GuestRegionXen < B > {
313313 /// Returns a pointer to the beginning of the memory region. Mutable accesses performed
314314 /// using the resulting pointer are not automatically accounted for by the dirty bitmap
315315 /// tracking functionality.
@@ -344,7 +344,7 @@ impl<B: Bitmap> MmapRegion<B> {
344344 ///
345345 /// This is mostly a sanity check available for convenience, as different file descriptors
346346 /// can alias the same file.
347- pub fn fds_overlap < T : Bitmap > ( & self , other : & MmapRegion < T > ) -> bool {
347+ pub fn fds_overlap < T : Bitmap > ( & self , other : & GuestRegionXen < T > ) -> bool {
348348 if let Some ( f_off1) = self . file_offset ( ) {
349349 if let Some ( f_off2) = other. file_offset ( ) {
350350 if f_off1. file ( ) . as_raw_fd ( ) == f_off2. file ( ) . as_raw_fd ( ) {
@@ -390,7 +390,7 @@ impl<B: Bitmap> MmapRegion<B> {
390390 }
391391}
392392
393- impl < B : Bitmap > VolatileMemory for MmapRegion < B > {
393+ impl < B : Bitmap > VolatileMemory for GuestRegionXen < B > {
394394 type B = B ;
395395
396396 fn len ( & self ) -> usize {
@@ -1037,6 +1037,7 @@ mod tests {
10371037 use super :: * ;
10381038 use matches:: assert_matches;
10391039 use vmm_sys_util:: tempfile:: TempFile ;
1040+ use crate :: mmap:: GuestRegionXen ;
10401041
10411042 // Adding a helper method to extract the errno within an Error::Mmap(e), or return a
10421043 // distinctive value when the error is represented by another variant.
@@ -1071,7 +1072,7 @@ mod tests {
10711072 }
10721073 }
10731074
1074- impl MmapRegion {
1075+ impl GuestRegionXen {
10751076 /// Create an `MmapRegion` with specified `size` at GuestAdress(0)
10761077 pub fn new ( size : usize ) -> Result < Self > {
10771078 let range = MmapRange :: new_unix ( size, None , GuestAddress ( 0 ) ) ;
0 commit comments