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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
> ---
>  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@xxxxxxxxxx>

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux