@@ -19,12 +19,6 @@ use std::result;
19
19
use crate :: bitmap:: Bitmap ;
20
20
use crate :: guest_memory:: FileOffset ;
21
21
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
-
28
22
/// A `Bitmap` that can be created starting from an initial size.
29
23
pub trait NewBitmap : Bitmap + Default {
30
24
/// Create a new object based on the specified length in bytes.
@@ -90,7 +84,8 @@ pub(crate) mod tests {
90
84
use crate :: bitmap:: BS ;
91
85
use crate :: {
92
86
guest_memory, Address , Bytes , GuestAddress , GuestMemory , GuestMemoryError ,
93
- GuestMemoryRegion , GuestUsize , MemoryRegionAddress , VolatileMemory , VolatileSlice ,
87
+ GuestMemoryRegion , GuestUsize , MemoryRegionAddress , MmapRegion , VolatileMemory ,
88
+ VolatileSlice ,
94
89
} ;
95
90
96
91
use std:: io:: Write ;
@@ -154,7 +149,7 @@ pub(crate) mod tests {
154
149
any_backend ! {
155
150
#[ cfg( all( windows, feature = "backend-mmap" ) ) ]
156
151
Windows [ crate :: mmap_windows:: GuestRegionWindows <( ) >] ,
157
- #[ cfg( all( unix, feature = "backend-mmap" , not ( feature = "xen" ) ) ) ]
152
+ #[ cfg( all( unix, feature = "backend-mmap" ) ) ]
158
153
Mmap [ crate :: mmap_unix:: GuestRegionMmap <( ) >] ,
159
154
#[ cfg( all( unix, feature = "backend-mmap" , feature = "xen" ) ) ]
160
155
Xen [ crate :: mmap_xen:: MmapRegion ]
@@ -173,7 +168,7 @@ pub(crate) mod tests {
173
168
)
174
169
. unwrap ( ) ,
175
170
) ) ;
176
- #[ cfg( all( unix, feature = "backend-mmap" , not ( feature = "xen" ) ) ) ]
171
+ #[ cfg( all( unix, feature = "backend-mmap" ) ) ]
177
172
regions. push ( AnyRegion :: Mmap (
178
173
crate :: mmap_unix:: GuestRegionMmap :: new (
179
174
MmapRegion :: from_file ( f_off. clone ( ) , size) . unwrap ( ) ,
@@ -183,8 +178,12 @@ pub(crate) mod tests {
183
178
) ) ;
184
179
#[ cfg( all( unix, feature = "backend-mmap" , feature = "xen" ) ) ]
185
180
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 ( ) ,
188
187
) ) ;
189
188
regions
190
189
}
@@ -203,14 +202,15 @@ pub(crate) mod tests {
203
202
)
204
203
. unwrap ( ) ,
205
204
) ) ;
206
- #[ cfg( all( unix, feature = "backend-mmap" , not ( feature = "xen" ) ) ) ]
205
+ #[ cfg( all( unix, feature = "backend-mmap" ) ) ]
207
206
regions. push ( AnyRegion :: Mmap (
208
207
crate :: mmap_unix:: GuestRegionMmap :: new ( MmapRegion :: new ( size) . unwrap ( ) , addr)
209
208
. unwrap ( ) ,
210
209
) ) ;
211
210
#[ cfg( all( unix, feature = "backend-mmap" , feature = "xen" ) ) ]
212
211
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 ( ) ,
214
214
) ) ;
215
215
regions
216
216
}
0 commit comments