mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2024-11-25 05:03:05 +00:00
vmm_vhost: fix the VFIO implementation of set_nonblocking()
The set_nonblocking() implementation of the VFIO Listener was marked as unimplemented and caused a crash. However, given that accept() on a VFIO listener never blocks, it is just as safe to mark the operation as successful, since the behavior of accept() won't be impacted and it will behave properly both in blocking and non-blocking modes. Removing this panic will allow us to safely use the Listener's interface set_nonblocking() method in generic code. BUG=b:229554679 TEST=vhost-user console device works. TEST=vvu console device works. Change-Id: Ibbde7bcd048505fc3a84eb4881a74285bae6bf54 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3591111 Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
This commit is contained in:
parent
b524833ab8
commit
2532c07b39
1 changed files with 2 additions and 1 deletions
3
third_party/vmm_vhost/src/connection/vfio.rs
vendored
3
third_party/vmm_vhost/src/connection/vfio.rs
vendored
|
@ -88,7 +88,8 @@ impl<D: Device> ListenerTrait for Listener<D> {
|
|||
}
|
||||
|
||||
fn set_nonblocking(&self, _block: bool) -> Result<()> {
|
||||
unimplemented!("set_nonblocking");
|
||||
// `accept` will never block on a VFIO connection.
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue