mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vmm: Enable FD-based VFIO devices
Signed-off-by: Bo Chen <bchen@crusoe.ai> Assisted-by: Claude:Opus-4.7
This commit is contained in:
@@ -786,10 +786,11 @@ where
|
||||
|
||||
impl ApplyLandlock for DeviceConfig {
|
||||
fn apply_landlock(&self, landlock: &mut Landlock) -> LandlockResult<()> {
|
||||
let path = self
|
||||
.path
|
||||
.as_deref()
|
||||
.expect("DeviceConfig::parse and OpenAPI spec enforce a path");
|
||||
// When the device is supplied via an externally-opened FD, there is no
|
||||
// path to grant access to: the file is already open. Skip the rule.
|
||||
let Some(path) = self.path.as_deref() else {
|
||||
return Ok(());
|
||||
};
|
||||
let device_path = fs::read_link(path).map_err(LandlockError::OpenPath)?;
|
||||
let iommu_group = device_path.file_name();
|
||||
let iommu_group_str = iommu_group
|
||||
|
||||
Reference in New Issue
Block a user