pub fn new(device_fd: VfioContainerDeviceHandle) -> Result<Self> {
        let container = OpenOptions::new()
            .read(true)
            .write(true)
            .open("/dev/vfio/vfio")
            .map_err(VfioError::OpenContainer)?;

        let container = VfioContainer {
            container,
            device_fd,
            groups: Mutex::new(HashMap::new()),
        };
        container.check_api_version()?;
        #[cfg(not(feature = "noiommu"))]
        container.check_extension(VFIO_TYPE1v2_IOMMU)?;
        #[cfg(feature = "noiommu")]
        container.check_extension(VFIO_NOIOMMU_IOMMU)?;

        Ok(container)
    }
/// Create a container wrapper object.
///
/// # Arguments
/// * `device_fd`: file handle of the VFIO device.
Create a container wrapper object.
Create a container wrapper object .
pub fn new(device_fd: VfioContainerDeviceHandle) -> Result<Self> {
        let container = OpenOptions::new()
            .read(true)
            .write(true)
            .open("/dev/vfio/vfio")
            .map_err(VfioError::OpenContainer)?;
        let container = VfioContainer {
            container,
            device_fd,
            groups: Mutex::new(HashMap::new()),
        };
        container.check_api_version()?;
        #[cfg(not(feature = "noiommu"))]
        container.check_extension(VFIO_TYPE1v2_IOMMU)?;
        #[cfg(feature = "noiommu")]
        container.check_extension(VFIO_NOIOMMU_IOMMU)?;
        Ok(container)
    }
pub fn new ( device_fd : VfioContainerDeviceHandle ) -> Result < Self > { let container = OpenOptions :: new ( ) . read ( true ) . write ( true ) . open ( " " ) . map_err ( VfioError :: OpenContainer ) ? ; let container = VfioContainer { container , device_fd , groups : Mutex :: new ( HashMap :: new ( ) ) , } ; container . check_api_version ( ) ? ; # [ cfg ( not ( feature " " ) ) ] container . check_extension ( VFIO_TYPE1v2_IOMMU ) ? ; # [ cfg ( feature " " ) ] container . check_extension ( VFIO_NOIOMMU_IOMMU ) ? ; Ok ( container ) }
Create a container wrapper object.
Create a container wrapper object .
device_fd
VfioContainerDeviceHandle