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:
Songqian Li
2024-08-29 15:58:50 +08:00
committed by Bo Chen
parent c72414552b
commit 2c282a5a54
7 changed files with 184 additions and 0 deletions

View File

@@ -29,6 +29,8 @@ use vmm::landlock::{Landlock, LandlockError};
use vmm::vm_config;
#[cfg(feature = "fw_cfg")]
use vmm::vm_config::FwCfgConfig;
#[cfg(feature = "ivshmem")]
use vmm::vm_config::IvshmemConfig;
#[cfg(target_arch = "x86_64")]
use vmm::vm_config::SgxEpcConfig;
use vmm::vm_config::{
@@ -300,6 +302,12 @@ fn get_cli_options_sorted(
.help("Path to initramfs image")
.num_args(1)
.group("vm-config"),
#[cfg(feature = "ivshmem")]
Arg::new("ivshmem")
.long("ivshmem")
.help(IvshmemConfig::SYNTAX)
.num_args(1)
.group("vm-config"),
Arg::new("kernel")
.long("kernel")
.help(
@@ -1034,6 +1042,8 @@ mod unit_tests {
preserved_fds: None,
landlock_enable: false,
landlock_rules: None,
#[cfg(feature = "ivshmem")]
ivshmem: None,
};
assert_eq!(expected_vm_config, result_vm_config);