From nobody Sun Feb 8 18:43:56 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 1495551969765707.0411292644148; Tue, 23 May 2017 08:06:09 -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 2AD53C04B941; Tue, 23 May 2017 15:06:06 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D71C680E96; Tue, 23 May 2017 15:06:05 +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 65539180BAF7; Tue, 23 May 2017 15:06:05 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v4NF5sUC002813 for ; Tue, 23 May 2017 11:05:54 -0400 Received: by smtp.corp.redhat.com (Postfix) id 42AC67849F; Tue, 23 May 2017 15:05:54 +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 BE188784A8 for ; Tue, 23 May 2017 15:05:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 2AD53C04B941 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 2AD53C04B941 From: Michal Privoznik To: libvir-list@redhat.com Date: Tue, 23 May 2017 17:05:40 +0200 Message-Id: <3376ed9f7bca7c9ed73eead020abde1279f0a14d.1495551923.git.mprivozn@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [libvirt-perl][PATCH 6/7] Register VOL_DOWNLOAD_SPARSE_STREAM & VOL_UPLOAD_SPARSE_STREAM constants 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, 23 May 2017 15:06:07 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Michal Privoznik --- Changes | 2 ++ Virt.xs | 4 ++++ lib/Sys/Virt/StorageVol.pm | 30 ++++++++++++++++++++++++++---- 3 files changed, 32 insertions(+), 4 deletions(-) diff --git a/Changes b/Changes index 989b795..6c671c0 100644 --- a/Changes +++ b/Changes @@ -9,6 +9,8 @@ Revision history for perl module Sys::Virt - Introduce Stream::recvHole() and Stream::sendHole() - Introduce Stream::sparse_recv_all() - Introduce Stream::sparse_send_all() + - Register VOL_DOWNLOAD_SPARSE_STREAM & + VOL_UPLOAD_SPARSE_STREAM constants =20 3.3.0 2017-05-08 =20 diff --git a/Virt.xs b/Virt.xs index fc282b8..663571c 100644 --- a/Virt.xs +++ b/Virt.xs @@ -9209,6 +9209,10 @@ BOOT: REGISTER_CONSTANT(VIR_STORAGE_VOL_USE_ALLOCATION, USE_ALLOCATION); REGISTER_CONSTANT(VIR_STORAGE_VOL_GET_PHYSICAL, GET_PHYSICAL); =20 + REGISTER_CONSTANT(VIR_STORAGE_VOL_DOWNLOAD_SPARSE_STREAM, VOL_DOWNLO= AD_SPARSE_STREAM); + + REGISTER_CONSTANT(VIR_STORAGE_VOL_UPLOAD_SPARSE_STREAM, VOL_UPLOAD_S= PARSE_STREAM); + stash =3D gv_stashpv( "Sys::Virt::Secret", TRUE ); REGISTER_CONSTANT(VIR_SECRET_USAGE_TYPE_NONE, USAGE_TYPE_NONE); REGISTER_CONSTANT(VIR_SECRET_USAGE_TYPE_VOLUME, USAGE_TYPE_VOLUME); diff --git a/lib/Sys/Virt/StorageVol.pm b/lib/Sys/Virt/StorageVol.pm index 42f10e8..82c3df2 100644 --- a/lib/Sys/Virt/StorageVol.pm +++ b/lib/Sys/Virt/StorageVol.pm @@ -141,17 +141,39 @@ Return the physical size in allocation =20 =3Dback =20 -=3Ditem $vol->download($st, $offset, $length); +=3Ditem $vol->download($st, $offset, $length, $flags=3D0); =20 Download data from C<$vol> using the stream C<$st>. If C<$offset> and C<$length> are non-zero, then restrict data to the specified -volume byte range. +volume byte range. The C<$flags> accept the following values: =20 -=3Ditem $vol->upload($st, $offset, $length); +=3Dover 4 + +=3Ditem Sys::Virt::StorageVol::VOL_DOWNLOAD_SPARSE_STREAM + +If this flag is is set in @flags effective transmission of holes +is enabled. This assumes using the stream C<$st> with combination of +C or C for honouring holes sent by server. + +=3Dback + +=3Ditem $vol->upload($st, $offset, $length, $flags=3D0); =20 Upload data to C<$vol> using the stream C<$st>. If C<$offset> and C<$length> are non-zero, then restrict data to the specified -volume byte range. +volume byte range. The C<$flags> accept the following values: + +=3Dover 4 + +=3Ditem Sys::Virt::StorageVol::VOL_UPLOAD_SPARSE_STREAM + +If this is set in C<$flags> effective transmission of holes is +enabled. This assumes using the stream C<$st> with combination of +C or C to preserve source file +sparseness. + +=3Dback =20 =3Dback =20 --=20 2.13.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list