Struct dbs_device::device_manager::IoManager
source · [−]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
sourceimpl 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.
sourceimpl IoManager
impl IoManager
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for IoManager
impl Send for IoManager
impl Sync for IoManager
impl Unpin for IoManager
impl !UnwindSafe for IoManager
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more