feat(vfio): add parameter type for legacy VFIO API

Signed-off-by: Changyuan Lyu <changyuanl@google.com>
This commit is contained in:
Changyuan Lyu 2024-10-27 17:28:38 -07:00 committed by Lencerf
parent c33baf4c61
commit 2bb4de20e7
2 changed files with 11 additions and 0 deletions

View file

@ -60,3 +60,13 @@ pub struct VfioParam {
/// Path to the iommu device. [default: /dev/iommu]
pub dev_iommu: Option<Box<Path>>,
}
#[derive(Debug, Deserialize, Help)]
pub struct VfioParamLegacy {
/// Path to a VFIO group file, e.g. /dev/vfio/12.
pub group: Box<Path>,
/// Device ID, e.g. 0000:06:0d.0.
pub device: Box<str>,
/// Path to the vfio device. [default: /dev/vfio/vfio]
pub dev_vfio: Option<Box<Path>>,
}

View file

@ -76,6 +76,7 @@ impl_help_for_types!(Bool, bool);
impl_help_for_types!(
String,
&str,
Box<str>,
String,
CStr,
CString,