mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-11-04 19:11:11 +00:00
vmm: Add iommu field to the VmConfig
Adding a simple iommu boolean field to the VmConfig structure so that we can later use it to create a virtio-iommu device for the current VM. Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
parent
03352f45f9
commit
6e0aa56f06
@ -176,6 +176,9 @@ components:
|
||||
$ref: '#/components/schemas/VhostUserBlkConfig'
|
||||
vsock:
|
||||
$ref: '#/components/schemas/VsockConfig'
|
||||
iommu:
|
||||
type: boolean
|
||||
default: false
|
||||
description: Virtual machine configuration
|
||||
|
||||
CpuConfig:
|
||||
|
@ -669,6 +669,8 @@ pub struct VmConfig {
|
||||
pub vhost_user_net: Option<Vec<VhostUserNetConfig>>,
|
||||
pub vhost_user_blk: Option<Vec<VhostUserBlkConfig>>,
|
||||
pub vsock: Option<Vec<VsockConfig>>,
|
||||
#[serde(default)]
|
||||
pub iommu: bool,
|
||||
}
|
||||
|
||||
impl VmConfig {
|
||||
@ -677,6 +679,8 @@ impl VmConfig {
|
||||
}
|
||||
|
||||
pub fn parse(vm_params: VmParams) -> Result<Self> {
|
||||
let iommu = false;
|
||||
|
||||
let mut disks: Option<Vec<DiskConfig>> = None;
|
||||
if let Some(disk_list) = &vm_params.disks {
|
||||
let mut disk_config_list = Vec::new();
|
||||
@ -778,6 +782,7 @@ impl VmConfig {
|
||||
vhost_user_net,
|
||||
vhost_user_blk,
|
||||
vsock,
|
||||
iommu,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user