mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vmm: ivshmem device support
Signed-off-by: Yi Wang <foxywang@tencent.com> Signed-off-by: Songqian Li <sionli@tencent.com>
This commit is contained in:
@@ -650,6 +650,26 @@ impl ApplyLandlock for VsockConfig {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "ivshmem")]
|
||||
pub const DEFAULT_IVSHMEM_SIZE: usize = 128;
|
||||
|
||||
#[cfg(feature = "ivshmem")]
|
||||
#[derive(Clone, Debug, PartialEq, Eq, Deserialize, Serialize)]
|
||||
pub struct IvshmemConfig {
|
||||
pub path: PathBuf,
|
||||
pub size: usize,
|
||||
}
|
||||
|
||||
#[cfg(feature = "ivshmem")]
|
||||
impl Default for IvshmemConfig {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
path: PathBuf::new(),
|
||||
size: DEFAULT_IVSHMEM_SIZE << 20,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(target_arch = "x86_64")]
|
||||
#[derive(Clone, Debug, PartialEq, Eq, Deserialize, Serialize)]
|
||||
pub struct SgxEpcConfig {
|
||||
@@ -896,6 +916,8 @@ pub struct VmConfig {
|
||||
#[serde(default)]
|
||||
pub landlock_enable: bool,
|
||||
pub landlock_rules: Option<Vec<LandlockConfig>>,
|
||||
#[cfg(feature = "ivshmem")]
|
||||
pub ivshmem: Option<IvshmemConfig>,
|
||||
}
|
||||
|
||||
impl VmConfig {
|
||||
|
||||
Reference in New Issue
Block a user