vfio-ioctls: Support pre-bound iommufd cdev fds#153
Merged
Conversation
Assisted-by: Claude:Opus-4.7 Signed-off-by: Bo Chen <bchen@crusoe.ai>
Signed-off-by: Bo Chen <bchen@crusoe.ai>
New constructor for cdev files whose iommufd bind state is meant to outlive the `VfioDevice`, e.g. for use cases where the caller has a cdev file that is already bound to the iommufd. Assisted-by: Claude:Opus-4.7 Signed-off-by: Bo Chen <bchen@crusoe.ai>
987691f to
8d8b8eb
Compare
Collaborator
Author
|
@rbradford @sboeuf PTAL. Thank you. Heads-up: this is the final change needed from the vfio crates to support VFIO live migration and accepting VFIO device fds in Cloud Hypervisor. I'm planning to cut a vfio-ioctls release once this lands. |
rbradford
reviewed
May 21, 2026
rbradford
approved these changes
May 21, 2026
sboeuf
approved these changes
May 21, 2026
bytefire
reviewed
May 21, 2026
Assisted-by: Claude:Opus-4.7 Signed-off-by: Bo Chen <bchen@crusoe.ai>
8d8b8eb to
a4ace80
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of the PR
Adds
VfioDevice::new_from_bound_fdfor callers that own the iommufdlifecycle and pass in a cdev file that is already bound to an iommufd.
Useful when the bind state must outlive the
VfioDevice.Commits:
vfio-ioctls: Split bind/attach helpers for cdev mode— refactorcdev setup so bind and attach can be invoked independently.
vfio-ioctls: Bump to iommufd-ioctls v0.2.0— pick up APIs neededfor the pre-bound path.
vfio-ioctls: Add VfioDevice::new_from_bound_fd— new constructorthat takes an already-bound cdev fd plus the caller's iommufd and
IOAS, and only does the attach step.
vfio-ioctls: Destroy owned IOAS on VfioIommufd drop— only theowning
VfioIommufddestroys the IOAS; externally provided onesare left to the caller.
Requirements
Before submitting your PR, please make sure you addressed the following
requirements:
git commit -s), and the commit message has max 60 characters for thesummary and max 75 characters for each description line.
test.
Release" section of CHANGELOG.md (if no such section exists, please create one).
unsafecode is properly documented.