diff --git a/vhost_user_backend/src/lib.rs b/vhost_user_backend/src/lib.rs index eae8107d0..3889245b2 100644 --- a/vhost_user_backend/src/lib.rs +++ b/vhost_user_backend/src/lib.rs @@ -74,7 +74,7 @@ pub trait VhostUserBackend: Send + Sync + 'static { &mut self, device_event: u16, evset: epoll::Events, - vrings: &Vec>>, + vrings: &[Arc>], ) -> result::Result; /// Get virtio device configuration. @@ -625,7 +625,7 @@ impl VhostUserSlaveReqHandler for VhostUserHandler { self.vrings[index as usize].write().unwrap().queue.ready = false; if let Some(fd) = self.vrings[index as usize].read().unwrap().kick.as_ref() { self.worker - .unregister_listener(fd.as_raw_fd(), epoll::Events::EPOLLIN, index as u64) + .unregister_listener(fd.as_raw_fd(), epoll::Events::EPOLLIN, u64::from(index)) .map_err(VhostUserError::ReqHandlerError)?; } @@ -659,7 +659,7 @@ impl VhostUserSlaveReqHandler for VhostUserHandler { self.vrings[index as usize].write().unwrap().queue.ready = true; if let Some(fd) = self.vrings[index as usize].read().unwrap().kick.as_ref() { self.worker - .register_listener(fd.as_raw_fd(), epoll::Events::EPOLLIN, index as u64) + .register_listener(fd.as_raw_fd(), epoll::Events::EPOLLIN, u64::from(index)) .map_err(VhostUserError::ReqHandlerError)?; }