From nobody Thu May 2 16:53:36 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.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1542724003044348.4907641294569; Tue, 20 Nov 2018 06:26:43 -0800 (PST) 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 F0A5D30820E4; Tue, 20 Nov 2018 14:26: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 07020648C2; Tue, 20 Nov 2018 14:26:38 +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 0B844180613A; Tue, 20 Nov 2018 14:26:34 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id wAKEQXcV026340 for ; Tue, 20 Nov 2018 09:26:33 -0500 Received: by smtp.corp.redhat.com (Postfix) id 819AC19C7D; Tue, 20 Nov 2018 14:26:33 +0000 (UTC) Received: from unknown4CEB42C824F4.redhat.com (ovpn-117-6.phx2.redhat.com [10.3.117.6]) by smtp.corp.redhat.com (Postfix) with ESMTP id 348022706E for ; Tue, 20 Nov 2018 14:26:29 +0000 (UTC) From: John Ferlan To: libvir-list@redhat.com Date: Tue, 20 Nov 2018 09:26:28 -0500 Message-Id: <20181120142628.31238-1-jferlan@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Subject: [libvirt] [libvirt-perl PATCH] Add support for virDomainSetIOThreadParams 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.47]); Tue, 20 Nov 2018 14:26:41 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: John Ferlan --- Although I suppose a build breaker, it would be good to have someone review my (lack of) Perl writing skills. The changes do allow the build to pass though ;-). Changes | 2 ++ lib/Sys/Virt.xs | 41 +++++++++++++++++++++++++++++++++++++++++ lib/Sys/Virt/Domain.pm | 39 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 82 insertions(+) diff --git a/Changes b/Changes index a76bb95..6adf2c7 100644 --- a/Changes +++ b/Changes @@ -3,6 +3,8 @@ Revision history for perl module Sys::Virt 4.10.0 2018-00-00 =20 - Add VIR_DOMAIN_SHUTOFF_DAEMON constant + - Add VIR_DOMAIN_IOTHREAD_POLL_{MAX_NS|GROW|SHRINK} params and the + virDomainSetIOThreadParams binding =20 4.8.0 2018-10-05 =20 diff --git a/lib/Sys/Virt.xs b/lib/Sys/Virt.xs index 3398971..07a5bca 100644 --- a/lib/Sys/Virt.xs +++ b/lib/Sys/Virt.xs @@ -6234,6 +6234,42 @@ del_iothread(dom, iothread_id, flags=3D0) _croak_error(); =20 =20 +void +set_iothread(dom, iothread_id, newparams, flags=3D0) + virDomainPtr dom; + unsigned int iothread_id; + HV *newparams; + unsigned int flags; + PREINIT: + virTypedParameterPtr params; + size_t nparams; + PPCODE: + nparams =3D 3; + Newx(params, nparams, virTypedParameter); + + strncpy(params[0].field, VIR_DOMAIN_IOTHREAD_POLL_MAX_NS, + VIR_TYPED_PARAM_FIELD_LENGTH); + params[0].type =3D VIR_TYPED_PARAM_ULLONG; + + strncpy(params[1].field, VIR_DOMAIN_IOTHREAD_POLL_GROW, + VIR_TYPED_PARAM_FIELD_LENGTH); + params[1].type =3D VIR_TYPED_PARAM_UINT; + + strncpy(params[2].field, VIR_DOMAIN_IOTHREAD_POLL_SHRINK, + VIR_TYPED_PARAM_FIELD_LENGTH); + params[2].type =3D VIR_TYPED_PARAM_UINT; + + nparams =3D vir_typed_param_from_hv(newparams, params, nparams); + + if (virDomainSetIOThreadParams(dom, iothread_id, + params, nparams, flags) < 0) { + vir_typed_param_safe_free(params, nparams); + _croak_error(); + } + + vir_typed_param_safe_free(params, nparams); + + int num_of_snapshots(dom, flags=3D0) virDomainPtr dom; @@ -8823,6 +8859,7 @@ BOOT: REGISTER_CONSTANT(VIR_DOMAIN_STATS_STATE, STATS_STATE); REGISTER_CONSTANT(VIR_DOMAIN_STATS_VCPU, STATS_VCPU); REGISTER_CONSTANT(VIR_DOMAIN_STATS_PERF, STATS_PERF); + REGISTER_CONSTANT(VIR_DOMAIN_STATS_IOTHREAD, STATS_IOTHREAD); =20 REGISTER_CONSTANT(VIR_CONNECT_GET_ALL_DOMAINS_STATS_ACTIVE, GET_ALL_= STATS_ACTIVE); REGISTER_CONSTANT(VIR_CONNECT_GET_ALL_DOMAINS_STATS_INACTIVE, GET_AL= L_STATS_INACTIVE); @@ -9129,6 +9166,10 @@ BOOT: REGISTER_CONSTANT_STR(VIR_PERF_PARAM_ALIGNMENT_FAULTS, PERF_PARAM_AL= IGNMENT_FAULTS); REGISTER_CONSTANT_STR(VIR_PERF_PARAM_EMULATION_FAULTS, PERF_PARAM_EM= ULATION_FAULTS); =20 + REGISTER_CONSTANT_STR(VIR_DOMAIN_IOTHREAD_POLL_MAX_NS, IOTHREAD_PARA= M_POLL_MAX_NS); + REGISTER_CONSTANT_STR(VIR_DOMAIN_IOTHREAD_POLL_GROW, IOTHREAD_PARAM_= POLL_GROW); + REGISTER_CONSTANT_STR(VIR_DOMAIN_IOTHREAD_POLL_SHRINK, IOTHREAD_PARA= M_POLL_SHRINK); + REGISTER_CONSTANT_STR(VIR_DOMAIN_BANDWIDTH_IN_AVERAGE, BANDWIDTH_IN_= AVERAGE); REGISTER_CONSTANT_STR(VIR_DOMAIN_BANDWIDTH_IN_PEAK, BANDWIDTH_IN_PEA= K); REGISTER_CONSTANT_STR(VIR_DOMAIN_BANDWIDTH_IN_BURST, BANDWIDTH_IN_BU= RST); diff --git a/lib/Sys/Virt/Domain.pm b/lib/Sys/Virt/Domain.pm index c56fe4e..a466efc 100644 --- a/lib/Sys/Virt/Domain.pm +++ b/lib/Sys/Virt/Domain.pm @@ -1423,6 +1423,13 @@ Delete an existing IOThread by the C<$iothread> valu= e from the guest domain. The C<$flags> parameter accepts one or more the CONFIG OPTION constants documented later, and defaults to 0 if omitted. =20 +=3Ditem $dom->set_iothread($iothread, $params, $nparams, $flags=3D0) + +Set parameters for the IOThread by the C<$iothread> value on the guest dom= ain. +The C<$params> parameter +The C<$flags> parameter accepts one or more the CONFIG OPTION constants +documented later, and defaults to 0 if omitted. + =3Ditem my @stats =3D $dom->get_cpu_stats($startCpu, $numCpus, $flags=3D0) =20 Requests the guests host physical CPU usage statistics, starting @@ -2989,6 +2996,34 @@ field in the *Stats APIs. =20 =3Dback =20 +=3Dhead2 IOTHREAD STATS + +The following constants defined IOThread statistics which +can be monitored for a guest + +=3Dover 4 + +=3Ditem Sys::Virt::Domain::IOTHREAD_PARAM_POLL_MAX_NS + +The maximum polling time that can be used by polling algorithm in ns. +The polling time starts at 0 (zero) and is the time spent by the guest +to process IOThread data before returning the CPU to the host. The +polling time will be dynamically modified over time based on the +poll_grow and poll_shrink parameters provided. + +=3Ditem Sys::Virt::Domain::IOTHREAD_PARAM_POLL_GROW + +This provides a value for the dynamic polling adjustment algorithm to +use to grow its polling interval up to the poll_max_ns value. + +=3Ditem Sys::Virt::Domain::IOTHREAD_PARAM_POLL_SHRINK + +This provides a value for the dynamic polling adjustment algorithm to +use to shrink its polling interval when the polling interval exceeds +the poll_max_ns value. + +=3Dback + =3Dhead2 VCPU FLAGS =20 The following constants are useful when getting/setting the @@ -4175,6 +4210,10 @@ Virtual CPU info =20 Performance event counter values =20 +=3Ditem Sys::Virt::Domain::STATS_IOTHREAD + +IOThread performance statistics values + =3Dback =20 =3Dhead2 PROCESS SIGNALS --=20 2.17.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list