Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Don't leak an FD when ejecting a vfio device - #8367

Merged
rbradford merged 1 commit into
cloud-hypervisor:mainfrom
dgreid:upstream/vfio-iommu-container-cleanup
Jun 11, 2026
Merged

rbradford merged 1 commit into
cloud-hypervisor:mainfrom
dgreid:upstream/vfio-iommu-container-cleanup

Conversation

@dgreid

@dgreid dgreid commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Currently ejecting a device leaks its mapping keeping the container fd open. Remove the mapping so the fd can be closed.

I don't have a great way to test this, so I'm going to lean on CI's vfio integration tests.

@dgreid
dgreid requested a review from a team as a code owner June 11, 2026 00:41
@dgreid dgreid changed the title Don't lead an FD when ejecting a vfio device Don't leak an FD when ejecting a vfio device Jun 11, 2026
@sboeuf
sboeuf requested a review from likebreath June 11, 2026 06:57
Comment thread vmm/src/device_manager.rs Outdated
}
};

// Remove the external DMA mapping registered with the virtual IOMMU if

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Not sure if this comment adds much value to the code

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, removed

Currently ejecting a device leaks its mapping keeping the container fd
open. Remove the mapping so the fd can be closed.

Assisted-by: Claude:Opus-4.8
Signed-off-by: Dylan Reid <[email protected]>
@dgreid
dgreid force-pushed the upstream/vfio-iommu-container-cleanup branch from d88c70d to 82be0f0 Compare June 11, 2026 14:24
@rbradford
rbradford added this pull request to the merge queue Jun 11, 2026
Merged via the queue into cloud-hypervisor:main with commit 0487035 Jun 11, 2026
41 checks passed
@github-project-automation github-project-automation Bot moved this from 🆕 New to ✅ Done in Cloud Hypervisor Roadmap Jul 8, 2026
@rbradford rbradford added the bug-fix Bug fix to include in release notes label Jul 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug-fix Bug fix to include in release notes

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

4 participants