[libvirt-python][PATCH 2/3] virStream: Use larger buffer for sendAll/recvAll methods

Pavel Hrdina phrdina at redhat.com
Fri Jul 3 12:15:21 UTC 2020

On Fri, Jul 03, 2020 at 01:30:59PM +0200, Michal Privoznik wrote:
> There are four methods which receive/send entire stream
> (sendAll(), recvAll(), sparseSendAll() and sparseRecvAll()). All
> these have an intermediary buffer which is either filled by
> incoming stream and passed to a user provided callback to handle
> the data, or the other way round - user fills it with data they
> want to send and the buffer is handed over to virStream.
> But the buffer is incredibly small which leads to smaller packets
> being sent and thus increased overhead. What we can do is to use
> the same buffer as their C counterparts do (e.g.
> virStreamSendAll()) - they all use VIR_NET_MESSAGE_LEGACY_PAYLOAD_MAX
> long buffer (which is the maximum size of a stream packet we
> send) - this is almost exactly 256KiB (it's 256KiB - 24B for the
> header).
> Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
> ---
>  libvirt-override-virStream.py | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)

Sounds reasonable but can you please define some constant instead of
using magic numbers?

Reviewed-by: Pavel Hrdina <phrdina at redhat.com>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20200703/7635902c/attachment-0001.sig>

More information about the libvir-list mailing list