fn update_ioeventfds_pass(&self, new_evtfds: &[RegionIoEventFd]) -> Result<()> {
        let old_evtfds = self.ioeventfds.lock().unwrap();
        let mut old_idx = 0;
        let mut new_idx = 0;

        while old_idx < old_evtfds.len() || new_idx < new_evtfds.len() {
            let old_fd = old_evtfds.get(old_idx);
            let new_fd = new_evtfds.get(new_idx);
            if old_fd.is_some() && (new_fd.is_none() || old_fd.unwrap().before(new_fd.unwrap())) {
                self.call_listeners(None, old_fd, ListenerReqType::DeleteIoeventfd)
                    .chain_err(|| {
                        ErrorKind::UpdateTopology(
                            old_fd.unwrap().addr_range.base.raw_value(),
                            old_fd.unwrap().addr_range.size,
                            RegionType::IO,
                        )
                    })?;
                old_idx += 1;
            } else if new_fd.is_some()
                && (old_fd.is_none() || new_fd.unwrap().before(old_fd.unwrap()))
            {
                self.call_listeners(None, new_fd, ListenerReqType::AddIoeventfd)
                    .chain_err(|| {
                        ErrorKind::UpdateTopology(
                            new_fd.unwrap().addr_range.base.raw_value(),
                            new_fd.unwrap().addr_range.size,
                            RegionType::IO,
                        )
                    })?;
                new_idx += 1;
            } else {
                old_idx += 1;
                new_idx += 1;
            }
        }

        Ok(())
    }
/// Updates ioeventfds according to New `RegionIoEventFd` array.
///
/// # Arguments
///
/// * `new_evtfds` - New `RegionIoEventFd` array.
Updates ioeventfds according to New `RegionIoEventFd` array.
Updates ioeventfds according to New ` RegionIoEventFd ` array .
fn update_ioeventfds_pass(&self, new_evtfds: &[RegionIoEventFd]) -> Result<()> {
        let old_evtfds = self.ioeventfds.lock().unwrap();
        let mut old_idx = 0;
        let mut new_idx = 0;
        while old_idx < old_evtfds.len() || new_idx < new_evtfds.len() {
            let old_fd = old_evtfds.get(old_idx);
            let new_fd = new_evtfds.get(new_idx);
            if old_fd.is_some() && (new_fd.is_none() || old_fd.unwrap().before(new_fd.unwrap())) {
                self.call_listeners(None, old_fd, ListenerReqType::DeleteIoeventfd)
                    .chain_err(|| {
                        ErrorKind::UpdateTopology(
                            old_fd.unwrap().addr_range.base.raw_value(),
                            old_fd.unwrap().addr_range.size,
                            RegionType::IO,
                        )
                    })?;
                old_idx += 1;
            } else if new_fd.is_some()
                && (old_fd.is_none() || new_fd.unwrap().before(old_fd.unwrap()))
            {
                self.call_listeners(None, new_fd, ListenerReqType::AddIoeventfd)
                    .chain_err(|| {
                        ErrorKind::UpdateTopology(
                            new_fd.unwrap().addr_range.base.raw_value(),
                            new_fd.unwrap().addr_range.size,
                            RegionType::IO,
                        )
                    })?;
                new_idx += 1;
            } else {
                old_idx += 1;
                new_idx += 1;
            }
        }
        Ok(())
    }
fn update_ioeventfds_pass ( & self , new_evtfds : & [ RegionIoEventFd ] ) -> Result < ( ) > { let old_evtfds = self . ioeventfds . lock ( ) . unwrap ( ) ; let mut old_idx = 0 ; let mut new_idx = 0 ; while old_idx < old_evtfds . len ( ) || new_idx < new_evtfds . len ( ) { let old_fd = old_evtfds . get ( old_idx ) ; let new_fd = new_evtfds . get ( new_idx ) ; if old_fd . is_some ( ) && ( new_fd . is_none ( ) || old_fd . unwrap ( ) . before ( new_fd . unwrap ( ) ) ) { self . call_listeners ( None , old_fd , ListenerReqType :: DeleteIoeventfd ) . chain_err ( | | { ErrorKind :: UpdateTopology ( old_fd . unwrap ( ) . addr_range . base . raw_value ( ) , old_fd . unwrap ( ) . addr_range . size , RegionType :: IO , ) } ) ? ; old_idx += 1 ; } else if new_fd . is_some ( ) && ( old_fd . is_none ( ) || new_fd . unwrap ( ) . before ( old_fd . unwrap ( ) ) ) { self . call_listeners ( None , new_fd , ListenerReqType :: AddIoeventfd ) . chain_err ( | | { ErrorKind :: UpdateTopology ( new_fd . unwrap ( ) . addr_range . base . raw_value ( ) , new_fd . unwrap ( ) . addr_range . size , RegionType :: IO , ) } ) ? ; new_idx += 1 ; } else { old_idx += 1 ; new_idx += 1 ; } } Ok ( ( ) ) }
Updates ioeventfds according to New `RegionIoEventFd` array.
Updates ioeventfds according to New ` RegionIoEventFd ` array .
&self
new_evtfds
&[RegionIoEventFd]
&self
new_evtfds
&[RegionIoEventFd]