From nobody Sun Feb 8 19:35:42 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 149494446718214.47725614588353; Tue, 16 May 2017 07:21:07 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5337DC04BD3E; Tue, 16 May 2017 14:19:54 +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 F2BCB87E2A; Tue, 16 May 2017 14:19:40 +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 296A84A48C; Tue, 16 May 2017 14:19:17 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v4GE4hPQ027918 for ; Tue, 16 May 2017 10:04:43 -0400 Received: by smtp.corp.redhat.com (Postfix) id 516AC860F2; Tue, 16 May 2017 14:04:43 +0000 (UTC) Received: from moe.brq.redhat.com (dhcp129-131.brq.redhat.com [10.34.129.131]) by smtp.corp.redhat.com (Postfix) with ESMTP id CB98B860E0 for ; Tue, 16 May 2017 14:04:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 5337DC04BD3E Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 5337DC04BD3E From: Michal Privoznik To: libvir-list@redhat.com Date: Tue, 16 May 2017 16:04:02 +0200 Message-Id: <822ea2b48fe5e6f8c55b44d7b927f1f76ad9d984.1494943031.git.mprivozn@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v3 22/31] Introduce virNetClientStreamRecvHole 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Tue, 16 May 2017 14:20:47 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This function will fetch previously processed stream holes and return their sum. Signed-off-by: Michal Privoznik Reviewed-by: John Ferlan --- src/libvirt_remote.syms | 1 + src/rpc/virnetclientstream.c | 16 ++++++++++++++++ src/rpc/virnetclientstream.h | 4 ++++ 3 files changed, 21 insertions(+) diff --git a/src/libvirt_remote.syms b/src/libvirt_remote.syms index 186d2c622..61c20d530 100644 --- a/src/libvirt_remote.syms +++ b/src/libvirt_remote.syms @@ -52,6 +52,7 @@ virNetClientStreamMatches; virNetClientStreamNew; virNetClientStreamQueuePacket; virNetClientStreamRaiseError; +virNetClientStreamRecvHole; virNetClientStreamRecvPacket; virNetClientStreamSendHole; virNetClientStreamSendPacket; diff --git a/src/rpc/virnetclientstream.c b/src/rpc/virnetclientstream.c index 4a3d843b1..bf3922cb5 100644 --- a/src/rpc/virnetclientstream.c +++ b/src/rpc/virnetclientstream.c @@ -583,6 +583,22 @@ virNetClientStreamSendHole(virNetClientStreamPtr st, } =20 =20 +int virNetClientStreamRecvHole(virNetClientPtr client ATTRIBUTE_UNUSED, + virNetClientStreamPtr st, + long long *length) +{ + if (!st->allowSkip) { + virReportError(VIR_ERR_OPERATION_INVALID, "%s", + _("Holes are not supported with this stream")); + return -1; + } + + *length =3D st->holeLength; + st->holeLength =3D 0; + return 0; +} + + int virNetClientStreamEventAddCallback(virNetClientStreamPtr st, int events, virNetClientStreamEventCallback cb, diff --git a/src/rpc/virnetclientstream.h b/src/rpc/virnetclientstream.h index 1774e5ac3..c4e01bf1c 100644 --- a/src/rpc/virnetclientstream.h +++ b/src/rpc/virnetclientstream.h @@ -67,6 +67,10 @@ int virNetClientStreamSendHole(virNetClientStreamPtr st, long long length, unsigned int flags); =20 +int virNetClientStreamRecvHole(virNetClientPtr client, + virNetClientStreamPtr st, + long long *length); + int virNetClientStreamEventAddCallback(virNetClientStreamPtr st, int events, virNetClientStreamEventCallback cb, --=20 2.13.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list