/// Send an IOTLB message to the in-kernel vhost backend.
///
/// # Arguments
/// * `msg` - IOTLB message to send.
Send an IOTLB message to the in-kernel vhost backend.
Send an IOTLB message to the in - kernel vhost backend .
fn send_iotlb_msg(&self, msg: &VhostIotlbMsg) -> Result<()> {
        let ret: ssize_t;
        if self.get_backend_features_acked() & (1 << VHOST_BACKEND_F_IOTLB_MSG_V2) != 0 {
            let mut msg_v2 = vhost_msg_v2 {
                type_: VHOST_IOTLB_MSG_V2,
                ..Default::default()
            };
            msg_v2.__bindgen_anon_1.iotlb.iova = msg.iova;
            msg_v2.__bindgen_anon_1.iotlb.size = msg.size;
            msg_v2.__bindgen_anon_1.iotlb.uaddr = msg.userspace_addr;
            msg_v2.__bindgen_anon_1.iotlb.perm = msg.perm as u8;
            msg_v2.__bindgen_anon_1.iotlb.type_ = msg.msg_type as u8;
            ret = unsafe {
                write(
                    self.as_raw_fd(),
                    &msg_v2 as *const vhost_msg_v2 as *const c_void,
                    mem::size_of::<vhost_msg_v2>(),
                )
            };
        } else {
            let mut msg_v1 = vhost_msg {
                type_: VHOST_IOTLB_MSG,
                ..Default::default()
            };
            msg_v1.__bindgen_anon_1.iotlb.iova = msg.iova;
            msg_v1.__bindgen_anon_1.iotlb.size = msg.size;
            msg_v1.__bindgen_anon_1.iotlb.uaddr = msg.userspace_addr;
            msg_v1.__bindgen_anon_1.iotlb.perm = msg.perm as u8;
            msg_v1.__bindgen_anon_1.iotlb.type_ = msg.msg_type as u8;
            ret = unsafe {
                write(
                    self.as_raw_fd(),
                    &msg_v1 as *const vhost_msg as *const c_void,
                    mem::size_of::<vhost_msg>(),
                )
            };
        }
        io_result(ret, ())
    }
fn send_iotlb_msg ( & self , msg : & VhostIotlbMsg ) -> Result < ( ) > { let ret : ssize_t ; if self . get_backend_features_acked ( ) & ( 1 << VHOST_BACKEND_F_IOTLB_MSG_V2 ) != 0 { let mut msg_v2 = vhost_msg_v2 { type_ : VHOST_IOTLB_MSG_V2 , .. Default :: default ( ) } ; msg_v2 . __bindgen_anon_1 . iotlb . iova = msg . iova ; msg_v2 . __bindgen_anon_1 . iotlb . size = msg . size ; msg_v2 . __bindgen_anon_1 . iotlb . uaddr = msg . userspace_addr ; msg_v2 . __bindgen_anon_1 . iotlb . perm = msg . perm as u8 ; msg_v2 . __bindgen_anon_1 . iotlb . type_ = msg . msg_type as u8 ; ret = unsafe { write ( self . as_raw_fd ( ) , & msg_v2 as * const vhost_msg_v2 as * const c_void , mem :: size_of :: < vhost_msg_v2 > ( ) , ) } ; } else { let mut msg_v1 = vhost_msg { type_ : VHOST_IOTLB_MSG , .. Default :: default ( ) } ; msg_v1 . __bindgen_anon_1 . iotlb . iova = msg . iova ; msg_v1 . __bindgen_anon_1 . iotlb . size = msg . size ; msg_v1 . __bindgen_anon_1 . iotlb . uaddr = msg . userspace_addr ; msg_v1 . __bindgen_anon_1 . iotlb . perm = msg . perm as u8 ; msg_v1 . __bindgen_anon_1 . iotlb . type_ = msg . msg_type as u8 ; ret = unsafe { write ( self . as_raw_fd ( ) , & msg_v1 as * const vhost_msg as * const c_void , mem :: size_of :: < vhost_msg > ( ) , ) } ; } io_result ( ret , ( ) ) }
Send an IOTLB message to the in-kernel vhost backend.
Send an IOTLB message to the in - kernel vhost backend .
&self
msg
&VhostIotlbMsg