On Thu, Dec 09, 2021 at 09:44:22AM +0100, Michal Privoznik wrote:
The aim of this function is to look at a virNetClientStream and tell whether the incoming packet (if there's one) contains data (type VIR_NET_STREAM) or a hole (type VIR_NET_STREAM_HOLE) and how big the section is. This function will be called from the remote driver in one of future commits. Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx> --- diff to v1: - initialize ret to -1 - lock stream even for checking allowSkip - return 1 only if message was really popped from the queue - If there's no incoming message, return the size of yet unprocessed hole. This size should always be zero though, because at EOF there's a hole of size 0. I have not met this case and I probably never will, but I figured it's better to be safe than sorry.
I tested as much as I could with this and it works both ways the way it should. Reviewed-by: Martin Kletzander <mkletzan@xxxxxxxxxx> or maybe Tested-by: ??? =)
Attachment:
signature.asc
Description: PGP signature