]> xenbits.xensource.com Git - libvirt.git/commit
virnetclientstream: Process stream messages later
authorMichal Privoznik <mprivozn@redhat.com>
Sat, 9 Apr 2016 07:24:51 +0000 (09:24 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 2 May 2016 05:56:38 +0000 (07:56 +0200)
commit18944b7aea46dc793f7c576321bd1247eaba4a19
treef2babb5944214bceb1ac160b5a952bc3f1a48125
parent435ee578a0e95c12404466ef30eec306879d3f74
virnetclientstream: Process stream messages later

There are two functions on the client that handle incoming stream
data.  The first one virNetClientStreamQueuePacket() is a low
level function that just processes the incoming stream data from
the socket and stores it into an internal structure. This happens
in the client event loop therefore the shorter the callbacks are,
the better. The second function virNetClientStreamRecvPacket()
then handles copying data from internal structure into a client
provided buffer.
Change introduced in this commit makes just that: new queue for
incoming stream packets is introduced. Then instead of copying
data into intermediate internal buffer and then copying them into
user buffer, incoming stream messages are queue into the queue
and data is copied just once - in the upper layer function
virNetClientStreamRecvPacket(). In the end, there's just one
copying of data and therefore shorter event loop callback. This
should boost the performance which has proven to be the case in
my testing.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
src/rpc/virnetclientstream.c