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:
Sebastien Boeuf
2020-03-09 14:08:59 +01:00
committed by Rob Bradford
parent 6cbdb9aa47
commit 81173bf4ab
2 changed files with 15 additions and 6 deletions
+3
View File
@@ -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,
})
}
}