pub struct BitmapMmapRegion { /* private fields */ }
Expand description
BitmapMmapRegion
implements a bitmap tha can be replaced at runtime.
The main use case is to support live migration on vhost-user backends
(see VHOST_USER_PROTOCOL_F_LOG_SHMFD
and VHOST_USER_SET_LOG_BASE
in the vhost-user protocol
specification). It uses a fixed memory page size of VHOST_LOG_PAGE
bytes (i.e., 4096
bytes),
so it converts addresses to page numbers before setting or clearing the bits.
To use this bitmap you need to define the memory as GuestMemoryMmap<BitmapMmapRegion>
.
Note:
This implementation uses std::sync::RwLock
, the priority policy of the lock is dependent on
the underlying operating system’s implementation and does not guarantee any particular policy,
in systems other than linux a thread trying to acquire the lock may starve.
Trait Implementations§
Source§impl Bitmap for BitmapMmapRegion
impl Bitmap for BitmapMmapRegion
Source§impl BitmapReplace for BitmapMmapRegion
impl BitmapReplace for BitmapMmapRegion
type InnerBitmap = AtomicBitmapMmap
Source§fn replace(&self, bitmap: AtomicBitmapMmap)
fn replace(&self, bitmap: AtomicBitmapMmap)
Bitmap
Source§impl Clone for BitmapMmapRegion
impl Clone for BitmapMmapRegion
Source§fn clone(&self) -> BitmapMmapRegion
fn clone(&self) -> BitmapMmapRegion
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source
. Read more