File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55## Added
66- [[ 9]] ( https://github.com/cloud-hypervisor/iommufd/pull/9 ) Add ` Iommufd::destroy_iommu_object ` to release iommufd
77 objects explicitly.
8+ - [[ 9]] ( https://github.com/cloud-hypervisor/iommufd/pull/9 ) Add ` Iommufd::new_from_fd ` to construct a ` Iommufd ` from
9+ a pre-opened iommufd file.
810
911## Fixed
1012
Original file line number Diff line number Diff line change @@ -26,6 +26,12 @@ impl IommuFd {
2626 Ok ( IommuFd { iommufd } )
2727 }
2828
29+ /// New from an already-opened `/dev/iommu` file. Caller transfers
30+ /// ownership; closing the fd is now `IommuFd`'s responsibility.
31+ pub fn new_from_fd ( file : File ) -> Self {
32+ IommuFd { iommufd : file }
33+ }
34+
2935 pub fn destroy_iommu_object ( & self , id : u32 ) -> Result < ( ) > {
3036 let destroy_data = iommu_destroy {
3137 size : std:: mem:: size_of :: < iommu_destroy > ( ) as u32 ,
You can’t perform that action at this time.
0 commit comments