From nobody Wed Feb 11 10:03:09 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 149079600972789.68336533353533; Wed, 29 Mar 2017 07:00:09 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D147BC0ABF2D; Wed, 29 Mar 2017 14:00:07 +0000 (UTC) Received: from colo-mx.corp.redhat.com (unknown [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8D5C8996BE; Wed, 29 Mar 2017 14:00:07 +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 24F855EC62; Wed, 29 Mar 2017 14:00:07 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v2TDuamN019472 for ; Wed, 29 Mar 2017 09:56:36 -0400 Received: by smtp.corp.redhat.com (Postfix) id 895287FBD2; Wed, 29 Mar 2017 13:56:36 +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 103437F957 for ; Wed, 29 Mar 2017 13:56:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com D147BC0ABF2D 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 D147BC0ABF2D From: Michal Privoznik To: libvir-list@redhat.com Date: Wed, 29 Mar 2017 15:56:28 +0200 Message-Id: <35c25bfe0cdfb7305e1ad4cb3e5020fea13e371d.1490795725.git.mprivozn@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Subject: [libvirt] [libvirt-perl][PATCH 2/3] Add virDomainSetBlockThreshold API 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Wed, 29 Mar 2017 14:00:08 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Michal Privoznik --- Changes | 1 + Virt.xs | 12 ++++++++++++ lib/Sys/Virt/Domain.pm | 9 +++++++++ 3 files changed, 22 insertions(+) diff --git a/Changes b/Changes index 4d6136f..3faaf08 100644 --- a/Changes +++ b/Changes @@ -12,6 +12,7 @@ Revision history for perl module Sys::Virt - Add PERF_PARAM_ALIGNMENT_FAULTS constant - Add PERF_PARAM_EMULATION_FAULTS constant - Add block threshold event + - Add virDomainSetBlockThreshold API =20 3.1.0 2017-03-03 =20 diff --git a/Virt.xs b/Virt.xs index e0588f0..a05cf4d 100644 --- a/Virt.xs +++ b/Virt.xs @@ -6120,6 +6120,18 @@ send_process_signal(dom, pidsv, signum, flags=3D0) if (virDomainSendProcessSignal(dom, pid, signum, flags) < 0) _croak_error(); =20 +void +set_block_threshold(dom, dev, thresholdsv, flags=3D0) + virDomainPtr dom; + const char *dev; + SV *thresholdsv; + unsigned int flags; + PREINIT: + unsigned long long threshold; + PPCODE: + threshold =3D virt_SvIVull(thresholdsv); + if (virDomainSetBlockThreshold(dom, dev, threshold, flags) < 0) + _croak_error(); =20 void destroy(dom_rv, flags=3D0) diff --git a/lib/Sys/Virt/Domain.pm b/lib/Sys/Virt/Domain.pm index b46eca1..a192ad5 100644 --- a/lib/Sys/Virt/Domain.pm +++ b/lib/Sys/Virt/Domain.pm @@ -1924,6 +1924,15 @@ C<$signum> value must be one of the constants listed later, not a POSIX or Linux signal value. C<$flags> is currently unused and defaults to zero. =20 +=3Ditem $dom->set_block_threshold($dev, $threshold, $flags=3D0); + +Set the threshold level for delivering the +EVENT_ID_BLOCK_THRESHOLD if the device or backing chain element +described by C<$dev> is written beyond the set C<$threshold> +level. The threshold level is unset once the event fires. The +event might not be delivered at all if libvirtd was not running +at the moment when the threshold was reached. + =3Dback =20 =3Dhead1 CONSTANTS --=20 2.10.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list