From nobody Tue Apr 23 17:24:53 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1486719751978660.8113492850604; Fri, 10 Feb 2017 01:42:31 -0800 (PST) Received: from localhost ([::1]:42744 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cc7io-0004HJ-V7 for importer@patchew.org; Fri, 10 Feb 2017 04:42:30 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59854) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cc7hk-0003XY-Q3 for qemu-devel@nongnu.org; Fri, 10 Feb 2017 04:41:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cc7hg-00037i-S4 for qemu-devel@nongnu.org; Fri, 10 Feb 2017 04:41:24 -0500 Received: from mx1.redhat.com ([209.132.183.28]:34986) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cc7hg-00037F-Ml for qemu-devel@nongnu.org; Fri, 10 Feb 2017 04:41:20 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EC55C201FB for ; Fri, 10 Feb 2017 09:41:19 +0000 (UTC) Received: from antique-work.brq.redhat.com (dhcp129-175.brq.redhat.com [10.34.129.175]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v1A9fI2l031884; Fri, 10 Feb 2017 04:41:18 -0500 From: Pavel Hrdina To: qemu-devel@nongnu.org Date: Fri, 10 Feb 2017 10:41:17 +0100 Message-Id: <3163c16d6ab4257f7be9ad44fe9cc0ce8c359e5a.1486718555.git.phrdina@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Fri, 10 Feb 2017 09:41:19 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH] monitor: add poll-* properties into query-iothreads result X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: dgilbert@redhat.com, armbru@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" IOthreads were recently extended by new properties that can enable/disable and configure aio polling. This will also allow other tools that uses QEMU to probe for existence of those new properties via query-qmp-schema. Signed-off-by: Pavel Hrdina Reviewed-by: Stefan Hajnoczi --- The other possible way would be to introduce object-list-properties which I think would be good in general for the same reason why device-list-properties exists. hmp.c | 9 +++++++-- iothread.c | 3 +++ qapi-schema.json | 15 ++++++++++++++- 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/hmp.c b/hmp.c index 2bc4f062bb..d713151cbc 100644 --- a/hmp.c +++ b/hmp.c @@ -2148,10 +2148,15 @@ void hmp_info_iothreads(Monitor *mon, const QDict *= qdict) { IOThreadInfoList *info_list =3D qmp_query_iothreads(NULL); IOThreadInfoList *info; + IOThreadInfo *value; =20 for (info =3D info_list; info; info =3D info->next) { - monitor_printf(mon, "%s: thread_id=3D%" PRId64 "\n", - info->value->id, info->value->thread_id); + value =3D info->value; + monitor_printf(mon, "%s:\n", value->id); + monitor_printf(mon, " thread_id=3D%" PRId64 "\n", value->thread_i= d); + monitor_printf(mon, " poll-max-ns=3D%" PRId64 "\n", value->poll_m= ax_ns); + monitor_printf(mon, " poll-grow=3D%" PRId64 "\n", value->poll_gro= w); + monitor_printf(mon, " poll-shrink=3D%" PRId64 "\n", value->poll_s= hrink); } =20 qapi_free_IOThreadInfoList(info_list); diff --git a/iothread.c b/iothread.c index 257b01d5f1..beeb870534 100644 --- a/iothread.c +++ b/iothread.c @@ -268,6 +268,9 @@ static int query_one_iothread(Object *object, void *opa= que) info =3D g_new0(IOThreadInfo, 1); info->id =3D iothread_get_id(iothread); info->thread_id =3D iothread->thread_id; + info->poll_max_ns =3D iothread->poll_max_ns; + info->poll_grow =3D iothread->poll_grow; + info->poll_shrink =3D iothread->poll_shrink; =20 elem =3D g_new0(IOThreadInfoList, 1); elem->value =3D info; diff --git a/qapi-schema.json b/qapi-schema.json index cbdffddbc6..a97a054c81 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -1422,10 +1422,23 @@ # # @thread-id: ID of the underlying host thread # +# @poll-max-ns: maximum polling time in ns, 0 means polling is disabled +# (since 2.9) +# +# @poll-grow: how many ns will be added to polling time, 0 means that it's= not +# configured (since 2.9) +# +# @poll-shrink: how many ns will be removed from polling time, 0 means that +# it's not configured (since 2.9) +# # Since: 2.0 ## { 'struct': 'IOThreadInfo', - 'data': {'id': 'str', 'thread-id': 'int'} } + 'data': {'id': 'str', + 'thread-id': 'int', + 'poll-max-ns': 'int', + 'poll-grow': 'int', + 'poll-shrink': 'int' } } =20 ## # @query-iothreads: --=20 2.11.1