argo: correctly report pending message length
authorNicholas Tsirakis <niko.tsirakis@gmail.com>
Wed, 12 Jun 2019 12:34:45 +0000 (08:34 -0400)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 12 Jun 2019 20:06:18 +0000 (21:06 +0100)
commit8966a3e9ab485f3a9d2adf66b71265163f8fb8eb
tree06c80584d90d71b3905c2b53f906943614e50300
parenta189ef027dbb7a3c0dfe566137f05c06d6685fb9
argo: correctly report pending message length

When a message is requeue'd in Xen's internal queue, the queue
entry contains the length of the message so that Xen knows to
send a VIRQ to the respective domain when enough space frees up
in the ring. Due to a small bug, however, Xen doesn't populate
the length of the msg if a given write fails, so this length is
always reported as zero. This causes Xen to spuriously wake up
a domain even when the ring doesn't have enough space.

This patch makes sure that the msg len is properly reported by
populating it in the event of a write failure.

Signed-off-by: Nicholas Tsirakis <tsirakisn@ainfosec.com>
Reviewed-by: Christopher Clark <christopher.w.clark@gmail.com>
xen/common/argo.c