GuestMemoryExtension

Trait GuestMemoryExtension 

Source
pub trait GuestMemoryExtension
where 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§

Source

fn describe(&self) -> GuestMemoryState

Describes GuestMemoryMmap through a GuestMemoryState struct.

Source

fn mark_dirty(&self, addr: GuestAddress, len: usize)

Mark memory range as dirty

Source

fn dump<T: WriteVolatile + Seek>( &self, writer: &mut T, ) -> Result<(), MemoryError>

Dumps all contents of GuestMemoryMmap to a writer.

Source

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.

Source

fn reset_dirty(&self)

Resets all the memory region bitmaps

Source

fn store_dirty_bitmap(&self, dirty_bitmap: &DirtyBitmap, page_size: usize)

Store the dirty bitmap in internal store

Source

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>,

Apply a function to each region in a memory range

Source

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.

Implementors§