From nobody Tue May 13 12:17:51 2025 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 1539963706796507.46085422565613; Fri, 19 Oct 2018 08:41:46 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 762FD30034B7; Fri, 19 Oct 2018 15:41:44 +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 039AB69EF5; Fri, 19 Oct 2018 15:41:44 +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 6CE064CA94; Fri, 19 Oct 2018 15:41:43 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w9JFDXS4007203 for ; Fri, 19 Oct 2018 11:13:33 -0400 Received: by smtp.corp.redhat.com (Postfix) id 5CCE86AE94; Fri, 19 Oct 2018 15:13:33 +0000 (UTC) Received: from unknown54ee7586bd10.attlocal.net.com (ovpn-116-156.phx2.redhat.com [10.3.116.156]) by smtp.corp.redhat.com (Postfix) with ESMTP id 14A116AE90 for ; Fri, 19 Oct 2018 15:13:32 +0000 (UTC) From: John Ferlan To: libvir-list@redhat.com Date: Fri, 19 Oct 2018 11:13:15 -0400 Message-Id: <20181019151326.16793-2-jferlan@redhat.com> In-Reply-To: <20181019151326.16793-1-jferlan@redhat.com> References: <20181019151326.16793-1-jferlan@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 01/12] qemu: Check for and return IOThread polling values if available 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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Fri, 19 Oct 2018 15:41:45 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" If there are IOThread polling values in the query-iothreads return buffer, then fill them in and set a bool indicating their presence. This will allow for displaying in a domain stats output eventually. Note that the QEMU values are managed a bit differently (as int's stored in int64_t's) than we will manage them (as unsigned long and int values). This is intentional to allow for value validation checking when it comes time to provide the values to QEMU. Signed-off-by: John Ferlan ACKed-by: Michal Privoznik --- src/qemu/qemu_monitor.h | 4 ++++ src/qemu/qemu_monitor_json.c | 15 +++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h index 48b142a4f4..c2991e2b16 100644 --- a/src/qemu/qemu_monitor.h +++ b/src/qemu/qemu_monitor.h @@ -1116,6 +1116,10 @@ typedef qemuMonitorIOThreadInfo *qemuMonitorIOThread= InfoPtr; struct _qemuMonitorIOThreadInfo { unsigned int iothread_id; int thread_id; + bool poll_valid; + unsigned long long poll_max_ns; + unsigned int poll_grow; + unsigned int poll_shrink; }; int qemuMonitorGetIOThreads(qemuMonitorPtr mon, qemuMonitorIOThreadInfoPtr **iothreads); diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 3de298c9e2..2e92984b44 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -7441,6 +7441,21 @@ qemuMonitorJSONGetIOThreads(qemuMonitorPtr mon, "'thread-id' data")); goto cleanup; } + + /* Fetch poll values (since QEMU 2.9 ) if available. QEMU + * stores these values as int64_t's; however, the qapi type + * is an int. The qapi/misc.json also mis-describes the grow + * and shrink values as pure add/remove values. The source + * util/aio-posix.c function aio_poll uses them as a factor + * or divisor in it's calculation. We will fetch and store + * them as defined in our structures. */ + if (virJSONValueObjectGetNumberUlong(child, "poll-max-ns", + &info->poll_max_ns) =3D=3D 0 = && + virJSONValueObjectGetNumberUint(child, "poll-grow", + &info->poll_grow) =3D=3D 0 && + virJSONValueObjectGetNumberUint(child, "poll-shrink", + &info->poll_shrink) =3D=3D 0) + info->poll_valid =3D true; } =20 ret =3D n; --=20 2.17.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list