mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-08-21 15:31:15 +00:00
virtio-devices: vsock: Fix clippy error
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
parent
1a01f2d82a
commit
6b40f2dbc5
@ -420,7 +420,7 @@ impl VsockMuxer {
|
|||||||
Some(EpollListener::LocalStream(_)) => {
|
Some(EpollListener::LocalStream(_)) => {
|
||||||
if let Some(EpollListener::LocalStream(mut stream)) = self.remove_listener(fd) {
|
if let Some(EpollListener::LocalStream(mut stream)) = self.remove_listener(fd) {
|
||||||
Self::read_local_stream_port(&mut stream)
|
Self::read_local_stream_port(&mut stream)
|
||||||
.and_then(|peer_port| Ok((self.allocate_local_port(), peer_port)))
|
.map(|peer_port| (self.allocate_local_port(), peer_port))
|
||||||
.and_then(|(local_port, peer_port)| {
|
.and_then(|(local_port, peer_port)| {
|
||||||
self.add_connection(
|
self.add_connection(
|
||||||
ConnMapKey {
|
ConnMapKey {
|
||||||
@ -517,7 +517,7 @@ impl VsockMuxer {
|
|||||||
evset: conn.get_polled_evset(),
|
evset: conn.get_polled_evset(),
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
.and_then(|_| {
|
.map(|_| {
|
||||||
if conn.has_pending_rx() {
|
if conn.has_pending_rx() {
|
||||||
// We can safely ignore any error in adding a connection RX indication. Worst
|
// We can safely ignore any error in adding a connection RX indication. Worst
|
||||||
// case scenario, the RX queue will get desynchronized, but we'll handle that
|
// case scenario, the RX queue will get desynchronized, but we'll handle that
|
||||||
@ -525,7 +525,6 @@ impl VsockMuxer {
|
|||||||
self.rxq.push(MuxerRx::ConnRx(key));
|
self.rxq.push(MuxerRx::ConnRx(key));
|
||||||
}
|
}
|
||||||
self.conn_map.insert(key, conn);
|
self.conn_map.insert(key, conn);
|
||||||
Ok(())
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -573,9 +572,8 @@ impl VsockMuxer {
|
|||||||
fd,
|
fd,
|
||||||
epoll::Event::new(evset, fd as u64),
|
epoll::Event::new(evset, fd as u64),
|
||||||
)
|
)
|
||||||
.and_then(|_| {
|
.map(|_| {
|
||||||
self.listener_map.insert(fd, listener);
|
self.listener_map.insert(fd, listener);
|
||||||
Ok(())
|
|
||||||
})
|
})
|
||||||
.map_err(Error::EpollAdd)?;
|
.map_err(Error::EpollAdd)?;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user