Struct vm_memory::mmap::MmapRegion

source ·
pub struct MmapRegion<B> { /* private fields */ }
Expand description

Helper structure for working with mmaped memory regions in Unix.

The structure is used for accessing the guest’s physical memory by mmapping it into the current process.

Limitations

When running a 64-bit virtual machine on a 32-bit hypervisor, only part of the guest’s physical memory may be mapped into the current process due to the limited virtual address space size of the process.

Implementations

Creates a shared anonymous mapping of size bytes.

Arguments
  • size - The size of the memory region in bytes.

Creates a shared file mapping of size bytes.

Arguments
  • file_offset - The mapping will be created at offset file_offset.start in the file referred to by file_offset.file.
  • size - The size of the memory region in bytes.

Returns a pointer to the beginning of the memory region. Mutable accesses performed using the resulting pointer are not automatically accounted for by the dirty bitmap tracking functionality.

Should only be used for passing this region to ioctls for setting guest memory.

Returns the size of this region.

Returns information regarding the offset into the file backing this region (if any).

Returns a reference to the inner bitmap object.

Trait Implementations

Formats the value using the given formatter. Read more
Executes the destructor for this type. Read more
Type used for dirty memory tracking.
Gets the size of this slice.
Returns a VolatileSlice of count bytes starting at offset. Read more
Check whether the region is empty.
Gets a slice of memory for the entire region that supports volatile access.
Gets a VolatileRef at offset.
Returns a VolatileArrayRef of n elements starting at offset. Read more
Returns a reference to an instance of T at offset. Read more
Returns a mutable reference to an instance of T at offset. Mutable accesses performed using the resulting reference are not automatically accounted for by the dirty bitmap tracking functionality. Read more
Returns a reference to an instance of T at offset. Mutable accesses performed using the resulting reference are not automatically accounted for by the dirty bitmap tracking functionality. Read more
Returns the sum of base and offset if the resulting address is valid.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.