From nobody Thu Apr 25 22:15:55 2024 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 1490796004386116.88236039889523; Wed, 29 Mar 2017 07:00:04 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 788064D6A3; Wed, 29 Mar 2017 14:00:02 +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 2F506881F3; Wed, 29 Mar 2017 14:00:02 +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 B7EB518523C8; Wed, 29 Mar 2017 14:00:01 +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 v2TDuZuT019467 for ; Wed, 29 Mar 2017 09:56:35 -0400 Received: by smtp.corp.redhat.com (Postfix) id B51DB7F957; Wed, 29 Mar 2017 13:56:35 +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 3E09A822A7 for ; Wed, 29 Mar 2017 13:56:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 788064D6A3 Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.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 788064D6A3 From: Michal Privoznik To: libvir-list@redhat.com Date: Wed, 29 Mar 2017 15:56:27 +0200 Message-Id: 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 1/3] Add block threshold event 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.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Wed, 29 Mar 2017 14:00:03 +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 | 48 ++++++++++++++++++++++++++++++++++++++++++++++= ++ lib/Sys/Virt/Domain.pm | 6 ++++++ t/030-api-coverage.t | 1 + 4 files changed, 56 insertions(+) diff --git a/Changes b/Changes index aee699d..4d6136f 100644 --- a/Changes +++ b/Changes @@ -11,6 +11,7 @@ Revision history for perl module Sys::Virt - Add PERF_PARAM_PAGE_FAULTS_MAJ constant - Add PERF_PARAM_ALIGNMENT_FAULTS constant - Add PERF_PARAM_EMULATION_FAULTS constant + - Add block threshold event =20 3.1.0 2017-03-03 =20 diff --git a/Virt.xs b/Virt.xs index e80182f..e0588f0 100644 --- a/Virt.xs +++ b/Virt.xs @@ -1136,6 +1136,50 @@ _domain_event_metadata_change_callback(virConnectPtr= con, =20 =20 static int +_domain_event_block_threshold_callback(virConnectPtr con, + virDomainPtr dom, + const char *dev, + const char *path, + unsigned long long threshold, + unsigned long long excess, + void *opaque) +{ + AV *data =3D opaque; + SV **self; + SV **cb; + SV *domref; + dSP; + + self =3D av_fetch(data, 0, 0); + cb =3D av_fetch(data, 1, 0); + + SvREFCNT_inc(*self); + + ENTER; + SAVETMPS; + + PUSHMARK(SP); + XPUSHs(*self); + domref =3D sv_newmortal(); + sv_setref_pv(domref, "Sys::Virt::Domain", (void *) dom); + virDomainRef(dom); + XPUSHs(domref); + XPUSHs(sv_2mortal(newSVpv(dev, 0))); + XPUSHs(sv_2mortal(newSVpv(path, 0))); + XPUSHs(sv_2mortal(newSViv(threshold))); + XPUSHs(sv_2mortal(newSViv(excess))); + PUTBACK; + + call_sv(*cb, G_DISCARD); + + FREETMPS; + LEAVE; + + return 0; +} + + +static int _network_event_lifecycle_callback(virConnectPtr con, virNetworkPtr net, int event, @@ -3375,6 +3419,9 @@ PREINIT: case VIR_DOMAIN_EVENT_ID_METADATA_CHANGE: callback =3D VIR_DOMAIN_EVENT_CALLBACK(_domain_event_metadata_ch= ange_callback); break; + case VIR_DOMAIN_EVENT_ID_BLOCK_THRESHOLD: + callback =3D VIR_DOMAIN_EVENT_CALLBACK(_domain_event_block_thres= hold_callback); + break; default: callback =3D VIR_DOMAIN_EVENT_CALLBACK(_domain_event_generic_cal= lback); break; @@ -8384,6 +8431,7 @@ BOOT: REGISTER_CONSTANT(VIR_DOMAIN_EVENT_ID_JOB_COMPLETED, EVENT_ID_JOB_CO= MPLETED); REGISTER_CONSTANT(VIR_DOMAIN_EVENT_ID_DEVICE_REMOVAL_FAILED, EVENT_I= D_DEVICE_REMOVAL_FAILED); REGISTER_CONSTANT(VIR_DOMAIN_EVENT_ID_METADATA_CHANGE, EVENT_ID_META= DATA_CHANGE); + REGISTER_CONSTANT(VIR_DOMAIN_EVENT_ID_BLOCK_THRESHOLD, EVENT_ID_BLOC= K_THRESHOLD); =20 REGISTER_CONSTANT(VIR_DOMAIN_EVENT_WATCHDOG_NONE, EVENT_WATCHDOG_NON= E); REGISTER_CONSTANT(VIR_DOMAIN_EVENT_WATCHDOG_PAUSE, EVENT_WATCHDOG_PA= USE); diff --git a/lib/Sys/Virt/Domain.pm b/lib/Sys/Virt/Domain.pm index eea8b26..b46eca1 100644 --- a/lib/Sys/Virt/Domain.pm +++ b/lib/Sys/Virt/Domain.pm @@ -3274,6 +3274,12 @@ Guest device removal has failed. =20 The domain metadata has changed =20 +=3Ditem Sys::Virt::Domain::EVENT_ID_BLOCK_THRESHOLD + +The event occurs when the hypervisor detects that the given +storage element was written beyond the point specified by +threshold. The event is useful for thin-provisioned storage. + =3Dback =20 =3Dhead2 IO ERROR EVENT CONSTANTS diff --git a/t/030-api-coverage.t b/t/030-api-coverage.t index 3a0d0c5..3049713 100644 --- a/t/030-api-coverage.t +++ b/t/030-api-coverage.t @@ -95,6 +95,7 @@ virConnectDomainEventMigrationIterationCallback virConnectDomainEventJobCompletedCallback virConnectDomainEventDeviceRemovalFailedCallback virConnectDomainEventMetadataChangeCallback +virConnectDomainEventBlockThresholdCallback =20 virConnectNetworkEventLifecycleCallback =20 --=20 2.10.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Thu Apr 25 22:15:55 2024 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 From nobody Thu Apr 25 22:15:55 2024 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 1490795801075854.0682742789018; Wed, 29 Mar 2017 06:56:41 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 8AF877E9F7; Wed, 29 Mar 2017 13:56:39 +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 5546D18992; Wed, 29 Mar 2017 13:56:39 +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 26B6118523C7; Wed, 29 Mar 2017 13:56:38 +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 v2TDubYU019479 for ; Wed, 29 Mar 2017 09:56:37 -0400 Received: by smtp.corp.redhat.com (Postfix) id 5C5E37F957; Wed, 29 Mar 2017 13:56:37 +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 D77F37FBF7 for ; Wed, 29 Mar 2017 13:56:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 8AF877E9F7 Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.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 8AF877E9F7 From: Michal Privoznik To: libvir-list@redhat.com Date: Wed, 29 Mar 2017 15:56:29 +0200 Message-Id: <9f3ec3a5b510bb637c073d026114099ed6c45627.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 3/3] Add VIR_MIGRATE_TLS constant 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.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Wed, 29 Mar 2017 13:56:40 +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 | 1 + lib/Sys/Virt/Domain.pm | 7 +++++++ 3 files changed, 9 insertions(+) diff --git a/Changes b/Changes index 3faaf08..f28523a 100644 --- a/Changes +++ b/Changes @@ -13,6 +13,7 @@ Revision history for perl module Sys::Virt - Add PERF_PARAM_EMULATION_FAULTS constant - Add block threshold event - Add virDomainSetBlockThreshold API + - Add VIR_MIGRATE_TLS constant =20 3.1.0 2017-03-03 =20 diff --git a/Virt.xs b/Virt.xs index a05cf4d..039f62d 100644 --- a/Virt.xs +++ b/Virt.xs @@ -8219,6 +8219,7 @@ BOOT: REGISTER_CONSTANT(VIR_MIGRATE_AUTO_CONVERGE, MIGRATE_AUTO_CONVERGE); REGISTER_CONSTANT(VIR_MIGRATE_RDMA_PIN_ALL, MIGRATE_RDMA_PIN_ALL); REGISTER_CONSTANT(VIR_MIGRATE_POSTCOPY, MIGRATE_POSTCOPY); + REGISTER_CONSTANT(VIR_MIGRATE_TLS, MIGRATE_TLS); =20 REGISTER_CONSTANT_STR(VIR_MIGRATE_PARAM_BANDWIDTH, MIGRATE_PARAM_BAN= DWIDTH); REGISTER_CONSTANT_STR(VIR_MIGRATE_PARAM_DEST_NAME, MIGRATE_PARAM_DES= T_NAME); diff --git a/lib/Sys/Virt/Domain.pm b/lib/Sys/Virt/Domain.pm index a192ad5..d69bb8d 100644 --- a/lib/Sys/Virt/Domain.pm +++ b/lib/Sys/Virt/Domain.pm @@ -2393,6 +2393,13 @@ Pin memory for RDMA transfer =20 Enable support for post-copy migration =20 +=3Ditem Sys::Virt::Domain::MIGRATE_TLS + +Setting this flag will cause the migration to attempt to use the +TLS environment configured by the hypervisor in order to perform +the migration. If incorrectly configured on either source or +destination, the migration will fail. + =3Dback =20 =3Dhead2 UNDEFINE CONSTANTS --=20 2.10.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list