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(a)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(a)redhat.com>