@@ -19,12 +19,6 @@ use std::result;
1919use crate :: bitmap:: Bitmap ;
2020use crate :: guest_memory:: FileOffset ;
2121
22- #[ cfg( all( not( feature = "xen" ) , unix) ) ]
23- pub use crate :: mmap_unix:: { Error as MmapRegionError , MmapRegion , MmapRegionBuilder } ;
24-
25- #[ cfg( all( feature = "xen" , unix) ) ]
26- pub use crate :: mmap_xen:: { Error as MmapRegionError , MmapRange , MmapRegion , MmapXenFlags } ;
27-
2822/// A `Bitmap` that can be created starting from an initial size.
2923pub trait NewBitmap : Bitmap + Default {
3024 /// Create a new object based on the specified length in bytes.
@@ -90,7 +84,8 @@ pub(crate) mod tests {
9084 use crate :: bitmap:: BS ;
9185 use crate :: {
9286 guest_memory, Address , Bytes , GuestAddress , GuestMemory , GuestMemoryError ,
93- GuestMemoryRegion , GuestUsize , MemoryRegionAddress , VolatileMemory , VolatileSlice ,
87+ GuestMemoryRegion , GuestUsize , MemoryRegionAddress , MmapRegion , VolatileMemory ,
88+ VolatileSlice ,
9489 } ;
9590
9691 use std:: io:: Write ;
@@ -154,7 +149,7 @@ pub(crate) mod tests {
154149 any_backend ! {
155150 #[ cfg( all( windows, feature = "backend-mmap" ) ) ]
156151 Windows [ crate :: mmap_windows:: GuestRegionWindows <( ) >] ,
157- #[ cfg( all( unix, feature = "backend-mmap" , not ( feature = "xen" ) ) ) ]
152+ #[ cfg( all( unix, feature = "backend-mmap" ) ) ]
158153 Mmap [ crate :: mmap_unix:: GuestRegionMmap <( ) >] ,
159154 #[ cfg( all( unix, feature = "backend-mmap" , feature = "xen" ) ) ]
160155 Xen [ crate :: mmap_xen:: MmapRegion ]
@@ -173,7 +168,7 @@ pub(crate) mod tests {
173168 )
174169 . unwrap ( ) ,
175170 ) ) ;
176- #[ cfg( all( unix, feature = "backend-mmap" , not ( feature = "xen" ) ) ) ]
171+ #[ cfg( all( unix, feature = "backend-mmap" ) ) ]
177172 regions. push ( AnyRegion :: Mmap (
178173 crate :: mmap_unix:: GuestRegionMmap :: new (
179174 MmapRegion :: from_file ( f_off. clone ( ) , size) . unwrap ( ) ,
@@ -183,8 +178,12 @@ pub(crate) mod tests {
183178 ) ) ;
184179 #[ cfg( all( unix, feature = "backend-mmap" , feature = "xen" ) ) ]
185180 regions. push ( AnyRegion :: Xen (
186- MmapRegion :: from_range ( MmapRange :: new_unix ( size, Some ( f_off. clone ( ) ) , addr) )
187- . unwrap ( ) ,
181+ crate :: MmapRegionXen :: from_range ( crate :: MmapRange :: new_unix (
182+ size,
183+ Some ( f_off. clone ( ) ) ,
184+ addr,
185+ ) )
186+ . unwrap ( ) ,
188187 ) ) ;
189188 regions
190189 }
@@ -203,14 +202,15 @@ pub(crate) mod tests {
203202 )
204203 . unwrap ( ) ,
205204 ) ) ;
206- #[ cfg( all( unix, feature = "backend-mmap" , not ( feature = "xen" ) ) ) ]
205+ #[ cfg( all( unix, feature = "backend-mmap" ) ) ]
207206 regions. push ( AnyRegion :: Mmap (
208207 crate :: mmap_unix:: GuestRegionMmap :: new ( MmapRegion :: new ( size) . unwrap ( ) , addr)
209208 . unwrap ( ) ,
210209 ) ) ;
211210 #[ cfg( all( unix, feature = "backend-mmap" , feature = "xen" ) ) ]
212211 regions. push ( AnyRegion :: Xen (
213- MmapRegion :: from_range ( MmapRange :: new_unix ( size, None , addr) ) . unwrap ( ) ,
212+ crate :: MmapRegionXen :: from_range ( crate :: MmapRange :: new_unix ( size, None , addr) )
213+ . unwrap ( ) ,
214214 ) ) ;
215215 regions
216216 }
0 commit comments