mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
virtio-devices: move userspace mapping to vm-device
Move UserspaceMapping to vm-device to avoid redefinition since UserspaceMapping is used by both `virtio-devices` and `device` crate. Signed-off-by: Songqian Li <sionli@tencent.com>
This commit is contained in:
@@ -14,4 +14,5 @@ hypervisor = { path = "../hypervisor" }
|
||||
serde = { workspace = true, features = ["derive", "rc"] }
|
||||
thiserror = { workspace = true }
|
||||
vfio-ioctls = { workspace = true, default-features = false }
|
||||
vm-memory = { workspace = true, features = ["backend-mmap"] }
|
||||
vmm-sys-util = { workspace = true }
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
//
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use vm_memory::{GuestAddress, GuestUsize};
|
||||
|
||||
mod bus;
|
||||
pub mod dma_mapping;
|
||||
@@ -58,3 +59,12 @@ pub enum Resource {
|
||||
/// KVM memslot index.
|
||||
KvmMemSlot(u32),
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct UserspaceMapping {
|
||||
pub host_addr: u64,
|
||||
pub mem_slot: u32,
|
||||
pub addr: GuestAddress,
|
||||
pub len: GuestUsize,
|
||||
pub mergeable: bool,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user