devices: virtio: vsock: Use async event without reset

When receiving guest data, we wait on an event after writing them out to
the named pipe so that we know that the write has completed. This resets
the event. Then we call `GetOverlappedResult` with `bWait` set. While
this does behave correctly because `GetOverlappedResult` checks the
internal status of the request before waiting, there's no need to have
the event get reset here.

BUG: b:255635953
TEST: Built and ran crosvm downstream.
Change-Id: Ic031821dda1e7ae696dfafa812afa4c0b6cff0ec
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4062049
Reviewed-by: Noah Gold <nkgold@google.com>
Commit-Queue: Richard Otap <rotap@google.com>
This commit is contained in:
Richard Otap 2022-11-10 09:42:34 -08:00 committed by crosvm LUCI
parent 616e84ae54
commit 2594731840

View file

@ -745,7 +745,7 @@ impl Worker {
// always be negligible, but will sometimes be non-zero in cases where
// traffic is high on the NamedPipe, especially a duplex pipe.
if let Ok(cloned_event) = write_completed_event.try_clone() {
if let Ok(async_event) = EventAsync::new(cloned_event, ex) {
if let Ok(async_event) = EventAsync::new_without_reset(cloned_event, ex) {
let _ = async_event.next_val().await;
} else {
error!(