pub struct GuestMemoryManager { /* private fields */ }Expand description
The OpenVMM memory manager.
Implementations§
Source§impl GuestMemoryManager
impl GuestMemoryManager
Sourcepub fn client(&self) -> GuestMemoryClient
pub fn client(&self) -> GuestMemoryClient
Returns an object to access guest memory.
Sourcepub fn device_memory_mapper(&self) -> DeviceMemoryMapper
pub fn device_memory_mapper(&self) -> DeviceMemoryMapper
Returns an object to map device memory into the VM.
Sourcepub fn dma_mapper_client(&self) -> DmaMapperClient
pub fn dma_mapper_client(&self) -> DmaMapperClient
Returns a client for registering DMA mappers (VFIO, iommufd).
Sourcepub fn ram_visibility_control(&self) -> RamVisibilityControl
pub fn ram_visibility_control(&self) -> RamVisibilityControl
Returns an object for manipulating the visibility state of different RAM regions.
Returns the shared memory resources that can be used to reconstruct the memory backing.
The returned mappable can be passed back via
RamBackingRequest::existing_mappable to create a new memory
manager with the same memory state. Only one instance of this type
should be managing a given memory backing at a time, though, or the
guest may see unpredictable results.
Returns None unless there is exactly one backing and it is
file-backed. This currently means multi-backing and private-memory
configurations cannot be restarted.
Sourcepub async fn attach_partition(
&mut self,
vtl: Vtl,
partition: &Arc<dyn PartitionMemoryMap>,
process: Option<RemoteProcess>,
) -> Result<(), PartitionAttachError>
pub async fn attach_partition( &mut self, vtl: Vtl, partition: &Arc<dyn PartitionMemoryMap>, process: Option<RemoteProcess>, ) -> Result<(), PartitionAttachError>
Attaches the guest memory to a partition, mapping it to the guest physical address space.
If process is provided, then allocate a VA range in that process for
the guest memory, and map the memory into the partition from that
process. This is necessary to work around WHP’s lack of support for
mapping multiple partitions from a single process.
TODO: currently, all VTLs will get the same mappings–no support for per-VTL memory protections is supported.