From 81025a6a18426ce49a7dc95472a0334fec484c28 Mon Sep 17 00:00:00 2001 From: Michal Privoznik Date: Wed, 8 Dec 2021 12:12:27 +0100 Subject: [PATCH] libvirt-stream: Don't require RPC module MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When implementing sparse streams, one of improvements I did was to increase client buffer size for sending/receiving stream data (commit v1.3.5-rc1~502). Previously, we were using 64KiB buffer while packets on RPC are 256KiB (usable data is slightly less because of the header). This meant that it took multiple calls of virStreamRecv()/virStreamSend() to serve a single packet of data. In my fix, I've included the virnetprotocol.h file which provides VIR_NET_MESSAGE_LEGACY_PAYLOAD_MAX macro which is the exact size of data in a single packet. However, including the file from libvirt-stream.c which implements public APIs is not right. If RPC module is not built then the file doesn't exists. Redefine the macro and drop the include. The size can never change anyways. Signed-off-by: Michal Privoznik Reviewed-by: Ján Tomko --- src/libvirt-stream.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/libvirt-stream.c b/src/libvirt-stream.c index bacbbfd325..80dbc83a59 100644 --- a/src/libvirt-stream.c +++ b/src/libvirt-stream.c @@ -23,12 +23,16 @@ #include "datatypes.h" #include "viralloc.h" #include "virlog.h" -#include "rpc/virnetprotocol.h" VIR_LOG_INIT("libvirt.stream"); #define VIR_FROM_THIS VIR_FROM_STREAMS +/* To avoid dragging in RPC code (which may be not compiled in), + * redefine this constant. Its value can't ever change, so we're + * safe to do so. */ +#define VIR_NET_MESSAGE_LEGACY_PAYLOAD_MAX 262120 + /** * virStreamNew: