mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-08-16 07:05:14 +00:00
Merge pull request #9687 from l8huang/vfio-pci-gk
agent: collect PCI address mapping for both vfio-pci-gk and vfio-pci device
This commit is contained in:
commit
028b10ce7a
@ -896,9 +896,10 @@ async fn vfio_pci_device_handler(
|
|||||||
}
|
}
|
||||||
|
|
||||||
group = Some(devgroup);
|
group = Some(devgroup);
|
||||||
|
|
||||||
pci_fixups.push((host, guestdev));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// collect PCI address mapping for both vfio-pci-gk and vfio-pci device
|
||||||
|
pci_fixups.push((host, guestdev));
|
||||||
}
|
}
|
||||||
|
|
||||||
let dev_update = if vfio_in_guest {
|
let dev_update = if vfio_in_guest {
|
||||||
@ -961,22 +962,22 @@ pub async fn add_devices(
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut sb = sandbox.lock().await;
|
|
||||||
for (host, guest) in update.pci {
|
|
||||||
if let Some(other_guest) = sb.pcimap.insert(host, guest) {
|
|
||||||
return Err(anyhow!(
|
|
||||||
"Conflicting guest address for host device {} ({} versus {})",
|
|
||||||
host,
|
|
||||||
guest,
|
|
||||||
other_guest
|
|
||||||
));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Update cgroup to allow all devices added to guest.
|
// Update cgroup to allow all devices added to guest.
|
||||||
insert_devices_cgroup_rule(spec, &dev_update.info, true, "rwm")
|
insert_devices_cgroup_rule(spec, &dev_update.info, true, "rwm")
|
||||||
.context("Update device cgroup")?;
|
.context("Update device cgroup")?;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let mut sb = sandbox.lock().await;
|
||||||
|
for (host, guest) in update.pci {
|
||||||
|
if let Some(other_guest) = sb.pcimap.insert(host, guest) {
|
||||||
|
return Err(anyhow!(
|
||||||
|
"Conflicting guest address for host device {} ({} versus {})",
|
||||||
|
host,
|
||||||
|
guest,
|
||||||
|
other_guest
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(process) = spec.process.as_mut() {
|
if let Some(process) = spec.process.as_mut() {
|
||||||
|
Loading…
Reference in New Issue
Block a user