pub trait GuestMemoryExtensionwhere
Self: Sized,{
// Required methods
fn describe(&self) -> GuestMemoryState;
fn mark_dirty(&self, addr: GuestAddress, len: usize);
fn dump<T: WriteVolatile + Seek>(
&self,
writer: &mut T,
) -> Result<(), MemoryError>;
fn dump_dirty<T: WriteVolatile + Seek>(
&self,
writer: &mut T,
dirty_bitmap: &DirtyBitmap,
) -> Result<(), MemoryError>;
fn reset_dirty(&self);
fn store_dirty_bitmap(&self, dirty_bitmap: &DirtyBitmap, page_size: usize);
fn try_for_each_region_in_range<F>(
&self,
addr: GuestAddress,
range_len: usize,
f: F,
) -> Result<(), GuestMemoryError>
where F: FnMut(&GuestRegionMmapExt, MemoryRegionAddress, usize) -> Result<(), GuestMemoryError>;
fn discard_range(
&self,
addr: GuestAddress,
range_len: usize,
) -> Result<(), GuestMemoryError>;
}Expand description
Defines the interface for snapshotting memory.
Required Methods§
Sourcefn describe(&self) -> GuestMemoryState
fn describe(&self) -> GuestMemoryState
Describes GuestMemoryMmap through a GuestMemoryState struct.
Sourcefn mark_dirty(&self, addr: GuestAddress, len: usize)
fn mark_dirty(&self, addr: GuestAddress, len: usize)
Mark memory range as dirty
Sourcefn dump<T: WriteVolatile + Seek>(
&self,
writer: &mut T,
) -> Result<(), MemoryError>
fn dump<T: WriteVolatile + Seek>( &self, writer: &mut T, ) -> Result<(), MemoryError>
Dumps all contents of GuestMemoryMmap to a writer.
Sourcefn dump_dirty<T: WriteVolatile + Seek>(
&self,
writer: &mut T,
dirty_bitmap: &DirtyBitmap,
) -> Result<(), MemoryError>
fn dump_dirty<T: WriteVolatile + Seek>( &self, writer: &mut T, dirty_bitmap: &DirtyBitmap, ) -> Result<(), MemoryError>
Dumps all pages of GuestMemoryMmap present in dirty_bitmap to a writer.
Sourcefn reset_dirty(&self)
fn reset_dirty(&self)
Resets all the memory region bitmaps
Sourcefn store_dirty_bitmap(&self, dirty_bitmap: &DirtyBitmap, page_size: usize)
fn store_dirty_bitmap(&self, dirty_bitmap: &DirtyBitmap, page_size: usize)
Store the dirty bitmap in internal store
Sourcefn try_for_each_region_in_range<F>(
&self,
addr: GuestAddress,
range_len: usize,
f: F,
) -> Result<(), GuestMemoryError>
fn try_for_each_region_in_range<F>( &self, addr: GuestAddress, range_len: usize, f: F, ) -> Result<(), GuestMemoryError>
Apply a function to each region in a memory range
Sourcefn discard_range(
&self,
addr: GuestAddress,
range_len: usize,
) -> Result<(), GuestMemoryError>
fn discard_range( &self, addr: GuestAddress, range_len: usize, ) -> Result<(), GuestMemoryError>
Discards a memory range, freeing up memory pages
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.