pub struct IoManager { /* private fields */ }
Expand description

IO manager to handle all trapped MMIO/PIO access requests.

All devices handling trapped MMIO/PIO accesses should register themself to the IO manager with trapped address ranges. When guest vm accesses those trapped MMIO/PIO address ranges, VM IO Exit events will be triggered and the VMM dispatches those events to IO manager. And then the registered callbacks will invoked by IO manager.

Implementations

Create a new instance of IoManager.

Register a new device to the IoManager, with trapped MMIO/PIO address ranges.

Arguments
  • device: device object to handle trapped IO access requests
  • resources: resources representing trapped MMIO/PIO address ranges. Only MMIO/PIO address ranges will be handled, and other types of resource will be ignored. So the caller does not need to filter out non-MMIO/PIO resources.

Unregister a device from IoManager.

Arguments
  • resources: resource list containing all trapped address ranges for the device.

Handle VM IO Exit events triggered by trapped MMIO read accesses.

Return error if failed to get the device.

Handle VM IO Exit events triggered by trapped MMIO write accesses.

Return error if failed to get the device.

Handle VM IO Exit events triggered by trapped PIO read accesses.

Return error if failed to get the device.

Handle VM IO Exit events triggered by trapped PIO write accesses.

Return error if failed to get the device.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Returns the “default value” for a type. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

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 resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

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.