From nobody Mon Feb 9 01:12:13 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1638977581; cv=none; d=zohomail.com; s=zohoarc; b=S4BKRFehIrJhfwJTPDw0ODbr3TJc/dBwyy8ZHxTLP4eZLIXLDkOLwmEUNpuuXXGwV/ln9G29RWKJgWw778+7bvQ04tTNScPBIfqbmPmPWDKvEKW1sK2DWPEaONblieMUSGzkcNXU7/elBfaMEHPss1t9+24UoDRowehZErYYPxI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1638977581; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=9IuM/oB9qABH7nB5gznuxugteU9l48NNX9MoR6FEdAU=; b=Yvwandg3wugkTdsTgisCzs89rMxb+V6uMTTlsGe1v03xfwm2xHdLxTYCVzkinS9rZIm9hTzYkd6JIOGIKeLIVxECm7nvdJCvek3oGwkZy9kD3bluRMFaJkQvVPaomLNXACqjcm5yUlzg91ysvJ1Kv9bxQQNm2sUFsARrRfJtHdA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1638977581707992.2022924857209; Wed, 8 Dec 2021 07:33:01 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-439-BtULbbmKP6yELXGvoRUZSQ-1; Wed, 08 Dec 2021 10:32:58 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 79004100CE83; Wed, 8 Dec 2021 15:32:53 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5B58145D75; Wed, 8 Dec 2021 15:32:53 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 1EED94BB7C; Wed, 8 Dec 2021 15:32:53 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1B8FTUrQ032075 for ; Wed, 8 Dec 2021 10:29:30 -0500 Received: by smtp.corp.redhat.com (Postfix) id B0827794DC; Wed, 8 Dec 2021 15:29:30 +0000 (UTC) Received: from maggie.redhat.com (unknown [10.43.2.64]) by smtp.corp.redhat.com (Postfix) with ESMTP id 385A6794DB for ; Wed, 8 Dec 2021 15:29:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1638977580; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=9IuM/oB9qABH7nB5gznuxugteU9l48NNX9MoR6FEdAU=; b=Y3wCVx7r2rVEyyAEeWBhxN/V+J15KB7qzhoYH+xHWAnBoHQKdu5FgkHd5UrZUsU4tMrUGx x5wXcmMRKl0EZOnAlDmUfVvmIluwppn2kYS9LU3SO0fop+URivEMPxpoYaTIkQKnu8FVC8 jDhjxxBel7ktw7dKie74PtmF2CCscqs= X-MC-Unique: BtULbbmKP6yELXGvoRUZSQ-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH v1 1/7] libvirt-stream: Don't require RPC module Date: Wed, 8 Dec 2021 16:29:03 +0100 Message-Id: <91e4c3fe9c39526946c03a38174ef78d85b14d82.1638977134.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1638977582936100001 Content-Type: text/plain; charset="utf-8" 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 --- 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 873d7b1d4e..86b13f39de 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" =20 VIR_LOG_INIT("libvirt.stream"); =20 #define VIR_FROM_THIS VIR_FROM_STREAMS =20 +/* 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 + =20 /** * virStreamNew: --=20 2.32.0