mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vm-device: Move ExternalDmaMapping trait out of vfio-ioctls
By moving the trait and its VFIO implementation out of vfio-ioctls, we give anticipate for the move to the vfio-ioctls from rust-vmm. Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
committed by
Samuel Ortiz
parent
727287b69d
commit
5bd05b1af0
17
vm-device/src/dma_mapping/mod.rs
Normal file
17
vm-device/src/dma_mapping/mod.rs
Normal file
@@ -0,0 +1,17 @@
|
||||
// Copyright © 2021 Intel Corporation
|
||||
//
|
||||
// SPDX-License-Identifier: Apache-2.0 OR BSD-3-Clause
|
||||
|
||||
pub mod vfio;
|
||||
|
||||
/// Trait meant for triggering the DMA mapping update related to an external
|
||||
/// device not managed fully through virtio. It is dedicated to virtio-iommu
|
||||
/// in order to trigger the map update anytime the mapping is updated from the
|
||||
/// guest.
|
||||
pub trait ExternalDmaMapping: Send + Sync {
|
||||
/// Map a memory range
|
||||
fn map(&self, iova: u64, gpa: u64, size: u64) -> std::result::Result<(), std::io::Error>;
|
||||
|
||||
/// Unmap a memory range
|
||||
fn unmap(&self, iova: u64, size: u64) -> std::result::Result<(), std::io::Error>;
|
||||
}
|
||||
Reference in New Issue
Block a user