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§
Source§impl IoManager
impl IoManager
Sourcepub fn register_device_io(
&mut self,
device: Arc<dyn DeviceIo>,
resources: &[Resource],
) -> Result<()>
pub fn register_device_io( &mut self, device: Arc<dyn DeviceIo>, resources: &[Resource], ) -> Result<()>
Register a new device to the IoManager, with trapped MMIO/PIO address ranges.
§Arguments
device
: device object to handle trapped IO access requestsresources
: 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.
Sourcepub fn unregister_device_io(&mut self, resources: &[Resource]) -> Result<()>
pub fn unregister_device_io(&mut self, resources: &[Resource]) -> Result<()>
Unregister a device from IoManager
.
§Arguments
resources
: resource list containing all trapped address ranges for the device.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for IoManager
impl !RefUnwindSafe for IoManager
impl Send for IoManager
impl Sync for IoManager
impl Unpin for IoManager
impl !UnwindSafe for IoManager
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more