mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2025-01-21 20:15:21 +00:00
6ab4e247e6
This patch has been cherry-picked from the Firecracker tree. The reference commit is 78819f35f63f5777a58e3e1e774b3270b32881ed. The vsock TX buffer flush operation would report inconsistent results, under specific circumstances. The flush operation is performed in two steps, since it's dealing with a ring buffer, an the data to be flushed may wrap around. If the first step was successful, but the second one failed, the whole flush operation would report an error, thus causing flow control accounting to lose track of the bytes that were successfully written by the first pass. This commit changes the flush behavior to always report success when some data has been written to the backing stream. Signed-off-by: Dan Horobeanu <dhr@amazon.com> Signed-off-by: Gabriel Ionescu <gbi@amazon.com> Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>