mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vmm: Add id field to DeviceConfig structure
Add a new field to the DeviceConfig, allowing the VMM to allocate a name to the VFIO devices. By identifying a VFIO device with a unique name, we can make sure a user can properly unplug it at any time. Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
committed by
Rob Bradford
parent
6cbdb9aa47
commit
81173bf4ab
@@ -889,6 +889,8 @@ pub struct DeviceConfig {
|
||||
pub path: PathBuf,
|
||||
#[serde(default)]
|
||||
pub iommu: bool,
|
||||
#[serde(default)]
|
||||
pub id: Option<String>,
|
||||
}
|
||||
|
||||
impl DeviceConfig {
|
||||
@@ -910,6 +912,7 @@ impl DeviceConfig {
|
||||
Ok(DeviceConfig {
|
||||
path: PathBuf::from(path_str),
|
||||
iommu: parse_on_off(iommu_str)?,
|
||||
id: None,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user