mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
pci: vfio_user: Allow a BAR to have multiple user memory regions
Similar to what's being supported for vfio devices, vfio-user devices may also have BARs that need multiple kvm user memory regions, e.g. device regions with `VFIO_REGION_INFO_CAP_SPARSE_MMAP`. Signed-off-by: Bo Chen <chen.bo@intel.com>
This commit is contained in:
+4
-6
@@ -211,10 +211,10 @@ impl Interrupt {
|
||||
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct UserMemoryRegion {
|
||||
slot: u32,
|
||||
start: u64,
|
||||
size: u64,
|
||||
host_addr: u64,
|
||||
pub slot: u32,
|
||||
pub start: u64,
|
||||
pub size: u64,
|
||||
pub host_addr: u64,
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
@@ -223,7 +223,6 @@ pub struct MmioRegion {
|
||||
pub length: GuestUsize,
|
||||
pub(crate) type_: PciBarRegionType,
|
||||
pub(crate) index: u32,
|
||||
pub(crate) mem_slot: Option<u32>,
|
||||
pub(crate) host_addr: Option<u64>,
|
||||
pub(crate) mmap_size: Option<usize>,
|
||||
pub(crate) user_memory_regions: Vec<UserMemoryRegion>,
|
||||
@@ -546,7 +545,6 @@ impl VfioCommon {
|
||||
length: region_size,
|
||||
type_: region_type,
|
||||
index: bar_id as u32,
|
||||
mem_slot: None,
|
||||
host_addr: None,
|
||||
mmap_size: None,
|
||||
user_memory_regions: Vec::new(),
|
||||
|
||||
Reference in New Issue
Block a user