mirror of
https://github.com/kata-containers/kata-containers.git
synced 2026-07-01 22:50:54 +00:00
runtime-rs: call network.remove() during resource cleanup
network.remove() — which detaches endpoints and rebinds VFs from vfio-pci back to the host driver — was never being called. ResourceManagerInner::cleanup() handled cgroups, bindmounts, share-fs, swap and ephemeral disks, but completely omitted the network teardown. Call network.remove() at the start of cleanup(), using the already-held self.hypervisor reference. Errors are logged as warnings rather than propagated, so they don't block the rest of the cleanup sequence. Signed-off-by: Fabiano Fidêncio <ffidencio@nvidia.com> Assisted-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -731,6 +731,13 @@ impl ResourceManagerInner {
|
||||
}
|
||||
|
||||
pub async fn cleanup(&self) -> Result<()> {
|
||||
// detach network endpoints (rebinds VFs from vfio-pci back to host driver)
|
||||
if let Some(network) = &self.network {
|
||||
if let Err(err) = network.remove(self.hypervisor.as_ref()).await {
|
||||
warn!(sl!(), "failed to remove network: {}", err);
|
||||
}
|
||||
}
|
||||
|
||||
// clean up cgroup
|
||||
self.cgroups_resource
|
||||
.delete()
|
||||
|
||||
Reference in New Issue
Block a user