From 2bb4de20e71e48ded07d046f724a8a786910c66c Mon Sep 17 00:00:00 2001 From: Changyuan Lyu Date: Sun, 27 Oct 2024 17:28:38 -0700 Subject: [PATCH] feat(vfio): add parameter type for legacy VFIO API Signed-off-by: Changyuan Lyu --- alioth/src/vfio/vfio.rs | 10 ++++++++++ serde-aco/src/help.rs | 1 + 2 files changed, 11 insertions(+) diff --git a/alioth/src/vfio/vfio.rs b/alioth/src/vfio/vfio.rs index 256def1..3982c34 100644 --- a/alioth/src/vfio/vfio.rs +++ b/alioth/src/vfio/vfio.rs @@ -60,3 +60,13 @@ pub struct VfioParam { /// Path to the iommu device. [default: /dev/iommu] pub dev_iommu: Option>, } + +#[derive(Debug, Deserialize, Help)] +pub struct VfioParamLegacy { + /// Path to a VFIO group file, e.g. /dev/vfio/12. + pub group: Box, + /// Device ID, e.g. 0000:06:0d.0. + pub device: Box, + /// Path to the vfio device. [default: /dev/vfio/vfio] + pub dev_vfio: Option>, +} diff --git a/serde-aco/src/help.rs b/serde-aco/src/help.rs index 88cd7c6..5990313 100644 --- a/serde-aco/src/help.rs +++ b/serde-aco/src/help.rs @@ -76,6 +76,7 @@ impl_help_for_types!(Bool, bool); impl_help_for_types!( String, &str, + Box, String, CStr, CString,