From nobody Sat Aug 1 21:31:28 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 38.145.34.151 as permitted sender) client-ip=38.145.34.151; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 38.145.34.151 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=fail(p=reject dis=none) header.from=linux.ibm.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [38.145.34.151]) by mx.zohomail.com with SMTPS id 1785604056079317.94916701981003; Sat, 1 Aug 2026 10:07:36 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 946C3418AD; Sat, 1 Aug 2026 13:07:34 -0400 (EDT) Received: from [172.19.199.10] (unknown [10.16.107.18]) by lists.libvirt.org (Postfix) with ESMTP id 698A0418E9; Sat, 1 Aug 2026 13:04:49 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 720F33FA2E; Sat, 1 Aug 2026 13:04:33 -0400 (EDT) Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (3072 bits) server-digest SHA256) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 715C13FA30 for ; Sat, 1 Aug 2026 13:04:32 -0400 (EDT) Received: from pps.filterd (m0360083.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 671FlecV936555 for ; Sat, 1 Aug 2026 17:04:31 GMT Received: from ppma11.dal12v.mail.ibm.com (db.9e.1632.ip4.static.sl-reverse.com [50.22.158.219]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4fs8a3hxd7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Sat, 01 Aug 2026 17:04:30 +0000 (GMT) Received: from pps.filterd (ppma11.dal12v.mail.ibm.com [127.0.0.1]) by ppma11.dal12v.mail.ibm.com (8.18.1.7/8.18.1.7) with ESMTP id 671GuLhf022840 for ; Sat, 1 Aug 2026 17:04:29 GMT Received: from smtprelay02.dal12v.mail.ibm.com ([172.16.1.4]) by ppma11.dal12v.mail.ibm.com (PPS) with ESMTPS id 4fna5ymab2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Sat, 01 Aug 2026 17:04:29 +0000 (GMT) Received: from smtpav05.wdc07v.mail.ibm.com (smtpav05.wdc07v.mail.ibm.com [10.39.53.232]) by smtprelay02.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 671H4SMQ19071512 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 1 Aug 2026 17:04:29 GMT Received: from smtpav05.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id AA94258061; Sat, 1 Aug 2026 17:04:28 +0000 (GMT) Received: from smtpav05.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 463DA58059; Sat, 1 Aug 2026 17:04:28 +0000 (GMT) Received: from IBM-GLTZVH3.ibm.com (unknown [9.61.254.33]) by smtpav05.wdc07v.mail.ibm.com (Postfix) with ESMTP; Sat, 1 Aug 2026 17:04:28 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=pp1; bh=EFGo/YewG5qrhvOcm K03RIlaCLIYX9Fg5geWMxbivcU=; b=QGz10HJY8N6KFZz1zA1bGmXtbh/lcC1aE jWYyIpTzL7N2tl0gGhBppf9k2tF7Wvy0KCtEVI7PIxItQTR2i0HIKV/vf2GJKq0c 1pOJPud37GLP7F6dPO3MCNm9MgZr2vwHWbzEHiZhRg1PYdiWjuteWcrqt08nPIGQ x8U72YmfSg/DkFJ5K5lzRRPd5jQjSjjNHPtzMCHknouPJQ1j4gqY28cayiGajcqD ekYj/nS4e0KYvoS7wg5lXFly2vO/LYY9pz/9IQE6R5m7cgwT+kGGAAyYsY+I6LKa /GjdDT0/ReFHpZ2lMc2ZpUP4VN6ze2lDPOJKbS26HJBHjDptu0X7g== From: Jaehoon Kim To: devel@lists.libvirt.org Subject: [PATCH v2 1/7] conf: add iothread poll-weight XML support Date: Sat, 1 Aug 2026 12:04:19 -0500 Message-ID: <20260801170425.730146-2-jhkim@linux.ibm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260801170425.730146-1-jhkim@linux.ibm.com> References: <20260801170425.730146-1-jhkim@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Authority-Analysis: v=2.4 cv=E6P9Y6dl c=1 sm=1 tr=0 ts=6a6e271e cx=c_pps a=aDMHemPKRhS1OARIsFnwRA==:117 a=aDMHemPKRhS1OARIsFnwRA==:17 a=Sv0fKeRqtYgA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22 a=iQ6ETzBq9ecOQQE5vZCe:22 a=VnNF1IyMAAAA:8 a=3Ecuj-iUfz3wvjMp-DMA:9 X-Proofpoint-ORIG-GUID: jBT5Aasi96VfcFoudg7KO1eZDuP54m5x X-Proofpoint-GUID: jBT5Aasi96VfcFoudg7KO1eZDuP54m5x X-Proofpoint-Spam-Info: AW1haW4tMjYwODAxMDEzNSBTYWx0ZWRfX+6tpu6FaZ4Wz UTwidV3B5+vydbLAE+eNUW4fNTwLlUXF18vp0B2kdTOKpxWRN7XjYeGoAcJnvWxtDIdhYHxLf/Z yvlA3/Tbz5FNx5o4N3xXC8soJYLgg+0= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwODAxMDEzNSBTYWx0ZWRfX+NRmpgM6jgY6 UcAqMb0WkJCj72mHUbcJMnO+U9sySDlv9FvcEFLXSPMA6W6oESAyKft9NeH6rkHaOx6xgINvIMq nX/hYMx3aSq8ThZe5JDaAG8+gj6IRv+wLf9H89umslzudDeCJ0j19/HygcJTzMJQ+lgRR8dAyL2 0yk90u+7oLkBdTVoC1qSVJ8dqRN9wBpHesenE1UJiwcgWouxLKOd9ZwkvoKpGQbZZYqi82xQrMn Ptf4Gkqthixy/zLg76712I8M83XuYz9OZUzKcDr0EuwxnWweqUH8Hb61COULahbhYqv+kzLMHOH k0N+aaBOB3onS/YKFuQxIlISQ1EvHNzmH7vItzx6CwGPuhBJO/vi56Wu04skTvCzMfHRwwytAIj QNV1YNR2TZbmaY7vkHBYbbBLAjNVKaem78xOXlUcUYuj1wwPGS2d/wnigpH5Oe35xWB9IfT5P/r Ir9srtf1GE9Torqw0cw== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-08-01_02,2026-07-30_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 clxscore=1015 lowpriorityscore=0 priorityscore=1501 suspectscore=0 adultscore=0 spamscore=0 malwarescore=0 impostorscore=0 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2608010135 Message-ID-Hash: 2I4VFKQHQH6JK7WWLXV5UGR6CJIFRHEQ X-Message-ID-Hash: 2I4VFKQHQH6JK7WWLXV5UGR6CJIFRHEQ X-MailFrom: jhkim@linux.ibm.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-devel.lists.libvirt.org-0; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: fiuczy@linux.ibm.com, shalini@linux.ibm.com, Jaehoon Kim X-Mailman-Version: 3.3.10 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1785604057827158500 Content-Type: text/plain; charset="utf-8" Add support for the iothread poll-weight XML attribute. Store the value in the internal iothread definition, parse it from the element, and format it back into domain XML. Also extend the schema to accept the new attribute and enforce the accepted range of [0, 63] in the domain validator. Signed-off-by: Jaehoon Kim --- src/conf/domain_conf.c | 14 +++++++++++++- src/conf/domain_conf.h | 2 ++ src/conf/domain_validate.c | 7 +++++++ src/conf/schemas/domaincommon.rng | 5 +++++ tests/genericxml2xmlindata/iothreadids.xml | 2 +- 5 files changed, 28 insertions(+), 2 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 45235d74bc..0cd0a22708 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -16988,7 +16988,9 @@ virDomainDefParseBootXML(xmlXPathContextPtr ctxt, * * 4 * - * + * + * + * * * * @@ -17036,6 +17038,12 @@ virDomainIOThreadIDDefParseXML(xmlNodePtr node) return NULL; =20 iothrid->set_poll_shrink =3D rc =3D=3D 1; + + if ((rc =3D virXMLPropUInt(pollNode, "weight", 10, VIR_XML_PROP_NO= NE, + &iothrid->poll_weight)) < 0) + return NULL; + + iothrid->set_poll_weight =3D rc =3D=3D 1; } =20 return g_steal_pointer(&iothrid); @@ -29015,6 +29023,7 @@ virDomainDefIothreadShouldFormat(const virDomainDef= *def) def->iothreadids[i]->set_poll_max_ns || def->iothreadids[i]->set_poll_grow || def->iothreadids[i]->set_poll_shrink || + def->iothreadids[i]->set_poll_weight || def->iothreadids[i]->thread_pool_min >=3D 0 || def->iothreadids[i]->thread_pool_max >=3D 0) return true; @@ -29088,6 +29097,9 @@ virDomainDefIOThreadsFormat(virBuffer *buf, if (iothread->set_poll_shrink) virBufferAsprintf(&pollAttrBuf, " shrink=3D'%llu'", iothre= ad->poll_shrink); =20 + if (iothread->set_poll_weight) + virBufferAsprintf(&pollAttrBuf, " weight=3D'%u'", iothread= ->poll_weight); + virXMLFormatElement(&iothreadChildBuf, "poll", &pollAttrBuf, N= ULL); =20 virXMLFormatElement(&childrenBuf, "iothread", &attrBuf, &iothr= eadChildBuf); diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 91f57de0f1..57c26d4070 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -2902,6 +2902,8 @@ struct _virDomainIOThreadIDDef { bool set_poll_grow; unsigned long long poll_shrink; bool set_poll_shrink; + unsigned int poll_weight; + bool set_poll_weight; =20 int thread_pool_min; int thread_pool_max; diff --git a/src/conf/domain_validate.c b/src/conf/domain_validate.c index 3946f92182..ab998de716 100644 --- a/src/conf/domain_validate.c +++ b/src/conf/domain_validate.c @@ -1931,6 +1931,13 @@ virDomainDefValidateIOThreads(const virDomainDef *de= f) if (virDomainDefValidateIOThreadsThreadPool(iothread->thread_pool_= min, iothread->thread_pool_= max) < 0) return -1; + + if (iothread->set_poll_weight && iothread->poll_weight > 63) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("poll weight %1$u is out of range [0, 63]"), + iothread->poll_weight); + return -1; + } } =20 if (def->defaultIOThread && diff --git a/src/conf/schemas/domaincommon.rng b/src/conf/schemas/domaincom= mon.rng index 81ffbfc2fa..1b6f972cec 100644 --- a/src/conf/schemas/domaincommon.rng +++ b/src/conf/schemas/domaincommon.rng @@ -990,6 +990,11 @@ + + + + + diff --git a/tests/genericxml2xmlindata/iothreadids.xml b/tests/genericxml2= xmlindata/iothreadids.xml index 671a467295..e9814854eb 100644 --- a/tests/genericxml2xmlindata/iothreadids.xml +++ b/tests/genericxml2xmlindata/iothreadids.xml @@ -7,7 +7,7 @@ 1 - + --=20 2.54.0 From nobody Sat Aug 1 21:31:28 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 38.145.34.151 as permitted sender) client-ip=38.145.34.151; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 38.145.34.151 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=fail(p=reject dis=none) header.from=linux.ibm.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [38.145.34.151]) by mx.zohomail.com with SMTPS id 1785604124735550.1222295642065; Sat, 1 Aug 2026 10:08:44 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 8CD8D3FBCA; Sat, 1 Aug 2026 13:08:43 -0400 (EDT) Received: from [172.19.199.10] (unknown [10.16.107.18]) by lists.libvirt.org (Postfix) with ESMTP id 17451417D7; Sat, 1 Aug 2026 13:04:56 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 439373FA2E; Sat, 1 Aug 2026 13:04:34 -0400 (EDT) Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (3072 bits) server-digest SHA256) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id D55763F89E for ; Sat, 1 Aug 2026 13:04:32 -0400 (EDT) Received: from pps.filterd (m0353725.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 671FmEwK881989 for ; Sat, 1 Aug 2026 17:04:32 GMT Received: from ppma23.wdc07v.mail.ibm.com (5d.69.3da9.ip4.static.sl-reverse.com [169.61.105.93]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4fs77ft0yu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Sat, 01 Aug 2026 17:04:32 +0000 (GMT) Received: from pps.filterd (ppma23.wdc07v.mail.ibm.com [127.0.0.1]) by ppma23.wdc07v.mail.ibm.com (8.18.1.7/8.18.1.7) with ESMTP id 671GuISh025352 for ; Sat, 1 Aug 2026 17:04:31 GMT Received: from smtprelay04.dal12v.mail.ibm.com ([172.16.1.6]) by ppma23.wdc07v.mail.ibm.com (PPS) with ESMTPS id 4fn8yhvfqn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Sat, 01 Aug 2026 17:04:31 +0000 (GMT) Received: from smtpav05.wdc07v.mail.ibm.com (smtpav05.wdc07v.mail.ibm.com [10.39.53.232]) by smtprelay04.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 671H4UoP19333876 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 1 Aug 2026 17:04:30 GMT Received: from smtpav05.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id ECD6A58063; Sat, 1 Aug 2026 17:04:29 +0000 (GMT) Received: from smtpav05.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8890458043; Sat, 1 Aug 2026 17:04:29 +0000 (GMT) Received: from IBM-GLTZVH3.ibm.com (unknown [9.61.254.33]) by smtpav05.wdc07v.mail.ibm.com (Postfix) with ESMTP; Sat, 1 Aug 2026 17:04:29 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=pp1; bh=VybglvSS0ipAcL2ML YFd034K0fsh+vHTNuILHqg2aPQ=; b=iko4p8tAT36OD6duaaAQ/e86+LJwPXDFq 38qbaApPk1sbRuU3i7XLRUdOGQB98MvLOXmFHCBSSPYo8w9yOTPdxdUVWZEkO8HH 1xj6BBfjPBpN+/dPqCIAGIc3bK25M48g0OenFAVc9Is3Q6TFVFVTslfryeQUfJTy zonaUGaB5TS+lD0b8jfcwPvc/lGrOJvICltPp/bHE2gT2VYRP/ovesUkq5IofDeS GPPSflnHION1NcxGrDWNcBdAmlWpOUktQiJT/0l2utMcp5srifmhIZRC8BfqBEUo InocjSWKN/iBITj7l4ajxHI62nO/hYMR/ZLMCZsL+QpKx4TBq63Tw== From: Jaehoon Kim To: devel@lists.libvirt.org Subject: [PATCH v2 2/7] docs: formatdomain: document iothread poll-weight Date: Sat, 1 Aug 2026 12:04:20 -0500 Message-ID: <20260801170425.730146-3-jhkim@linux.ibm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260801170425.730146-1-jhkim@linux.ibm.com> References: <20260801170425.730146-1-jhkim@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwODAxMDEzNSBTYWx0ZWRfX2i8r7WykYu5F gPbMYxKSiW70g7xrEyPnO6RxMEppa9aN5c5vkjMUbVanh/nojr9bb4vt88Ru95vqtfTk5uie1Dr 5mOrCM0HKqWrmOYdalVMhJcXCdi2reLIuqCLiihjaSkvsdUm0c6WEySmeMLU29TbLrzRoCpvnft 6HZHrASxweCwz4pUjEJ/lnPuF2UrGlgtub4DWn311JM9CKFzE1cVFJtCQVL9OOxh1JhwqYCkBxk DvKPyPxnC9D0ttfOg0qtmdRepuq+gi39GevSgiyK0Ad0Nfm00ezlJ2iWOetJueHVpmaTnMN6KiA gku0ztRfeYyrASnKxQ09bXQQFMryQFJQl15S7XoEUdD6TY4S/T/sBjGsHl+nnQTkNBU4+E+XAT2 P2r6Qy7P8h11q1edHFglhnpFYsdKYTmOnGpQqakG/rKLvf8eYWaf6sG0ObPNUxLCWsaSz1nbl9V wV/9cy7ntLJRCcSBJ0w== X-Authority-Analysis: v=2.4 cv=WIFPmHsR c=1 sm=1 tr=0 ts=6a6e2720 cx=c_pps a=3Bg1Hr4SwmMryq2xdFQyZA==:117 a=3Bg1Hr4SwmMryq2xdFQyZA==:17 a=Sv0fKeRqtYgA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22 a=V8glGbnc2Ofi9Qvn3v5h:22 a=VnNF1IyMAAAA:8 a=q6ly3UnAus1M01P6xgYA:9 a=O8hF6Hzn-FEA:10 X-Proofpoint-GUID: 7jWdWG8y6CneQW4h6cn39FsudfNuPUFu X-Proofpoint-ORIG-GUID: 7jWdWG8y6CneQW4h6cn39FsudfNuPUFu X-Proofpoint-Spam-Info: AW1haW4tMjYwODAxMDEzNSBTYWx0ZWRfX06IA6XdyG7A9 ED41/DNRX/VapYLCbAl6fNhoop5QFW9vqvz6OWuCDwql7cgjQBs893fE0rwU8SM07Iviz5LezR/ 44hGkN4pNs+v0rQr/s5zsosUe4zFWAY= X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-08-01_02,2026-07-30_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 lowpriorityscore=0 priorityscore=1501 phishscore=0 malwarescore=0 suspectscore=0 clxscore=1015 impostorscore=0 bulkscore=0 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2608010135 Message-ID-Hash: YLPH4ZNAOQILQEODVPEKL6PAWTVQHO3I X-Message-ID-Hash: YLPH4ZNAOQILQEODVPEKL6PAWTVQHO3I X-MailFrom: jhkim@linux.ibm.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-devel.lists.libvirt.org-0; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: fiuczy@linux.ibm.com, shalini@linux.ibm.com, Jaehoon Kim X-Mailman-Version: 3.3.10 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1785604125922158500 Content-Type: text/plain; charset="utf-8" Document the iothread poll-weight XML attribute in formatdomain. Extend the description of iothread polling controls to cover the new poll-weight attribute and how it relates to the existing poll-max, poll-grow, and poll-shrink settings. Also document the accepted range and the meaning of zero as a request for the hypervisor default. Signed-off-by: Jaehoon Kim --- docs/formatdomain.rst | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index 28c9170a37..7d2440abc6 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -815,7 +815,7 @@ host/guest with many LUNs. :since:`Since 1.2.8 (QEMU on= ly)` - + @@ -849,6 +849,12 @@ host/guest with many LUNs. :since:`Since 1.2.8 (QEMU o= nly)` polling. Attributes ``grow`` and ``shrink`` override (or disable when s= et to ``0``) the default steps for increasing/decreasing the polling interval= if the set interval is deemed insufficient or excessive. + :since:`Since 12.7.0` the optional attribute ``weight`` sets the shift = value + for the adaptive polling algorithm, controlling how much the most recent + event interval affects the next polling duration calculation. Larger va= lues + decrease the weight of recent events, producing more gradual adjustment= s. + Valid range is ``[0, 63]``. Omitting ``weight`` or setting it to ``0`` = lets + the hypervisor select its default value. ``defaultiothread`` This element represents the default event loop within hypervisor, where= I/O requests from devices not assigned to a specific IOThread are processed. --=20 2.54.0 From nobody Sat Aug 1 21:31:28 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 38.145.34.151 as permitted sender) client-ip=38.145.34.151; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 38.145.34.151 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=fail(p=reject dis=none) header.from=linux.ibm.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [38.145.34.151]) by mx.zohomail.com with SMTPS id 1785604211838209.57895537070362; Sat, 1 Aug 2026 10:10:11 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 993) id B33AC418C2; Sat, 1 Aug 2026 13:10:10 -0400 (EDT) Received: from [172.19.199.10] (unknown [10.16.107.18]) by lists.libvirt.org (Postfix) with ESMTP id EDC2A41805; Sat, 1 Aug 2026 13:05:01 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 993) id CB1DA3FA2E; Sat, 1 Aug 2026 13:04:35 -0400 (EDT) Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (3072 bits) server-digest SHA256) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id E6A733F9B8 for ; Sat, 1 Aug 2026 13:04:34 -0400 (EDT) Received: from pps.filterd (m0360083.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 671FnWMT940347; Sat, 1 Aug 2026 17:04:34 GMT Received: from ppma23.wdc07v.mail.ibm.com (5d.69.3da9.ip4.static.sl-reverse.com [169.61.105.93]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4fs8a3hxdc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 01 Aug 2026 17:04:33 +0000 (GMT) Received: from pps.filterd (ppma23.wdc07v.mail.ibm.com [127.0.0.1]) by ppma23.wdc07v.mail.ibm.com (8.18.1.7/8.18.1.7) with ESMTP id 671GuOSV025388; Sat, 1 Aug 2026 17:04:32 GMT Received: from smtprelay05.dal12v.mail.ibm.com ([172.16.1.7]) by ppma23.wdc07v.mail.ibm.com (PPS) with ESMTPS id 4fn8yhvfqp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 01 Aug 2026 17:04:32 +0000 (GMT) Received: from smtpav05.wdc07v.mail.ibm.com (smtpav05.wdc07v.mail.ibm.com [10.39.53.232]) by smtprelay05.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 671H4VXQ19006028 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 1 Aug 2026 17:04:31 GMT Received: from smtpav05.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1859858053; Sat, 1 Aug 2026 17:04:31 +0000 (GMT) Received: from smtpav05.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9EF0758059; Sat, 1 Aug 2026 17:04:30 +0000 (GMT) Received: from IBM-GLTZVH3.ibm.com (unknown [9.61.254.33]) by smtpav05.wdc07v.mail.ibm.com (Postfix) with ESMTP; Sat, 1 Aug 2026 17:04:30 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=pp1; bh=tsqhWMuKfubNdrr84 DtdeqLX5Qgig6LJb+BAW7olOm0=; b=TDEisGDkcmA4KYpy6MQTAJzpQz05zBR6I KEVIXF6YnkBApMGZ2/Zd4VRb7QsfLBnaVycf6RjcfenqVRuq1iwNLvy032uAnp+R FtUWH99sMvjZsKT4LTmcew41lwAhy0w+3qufhBX0gweW1gEgLog5K7pz5QAIjPlM Cocf5B03+YaMGqU2ui6VY55qyr+XCvIQ2GGjj5Dg6SHb2QB+eyik9CHu8Br4fWhU UQHUVOwKfD5CVyFbhMcEt8rmPE/SiqDK5K6vg+ltUFyKUj4YsC2kJkY3DXS5UsNh GzF5Mhf5xTv+1qmDm8U0wgMyUnmeRzK2kPGqKEtSSye8d1VDLO1hQ== From: Jaehoon Kim To: devel@lists.libvirt.org Subject: [PATCH v2 3/7] qemu: capabilities: add capability for iothread poll-weight Date: Sat, 1 Aug 2026 12:04:21 -0500 Message-ID: <20260801170425.730146-4-jhkim@linux.ibm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260801170425.730146-1-jhkim@linux.ibm.com> References: <20260801170425.730146-1-jhkim@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Authority-Analysis: v=2.4 cv=E6P9Y6dl c=1 sm=1 tr=0 ts=6a6e2721 cx=c_pps a=3Bg1Hr4SwmMryq2xdFQyZA==:117 a=3Bg1Hr4SwmMryq2xdFQyZA==:17 a=Sv0fKeRqtYgA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22 a=iQ6ETzBq9ecOQQE5vZCe:22 a=VnNF1IyMAAAA:8 a=20KFwNOVAAAA:8 a=G0atoXdAGNRzJAzzbwYA:9 X-Proofpoint-ORIG-GUID: 26aK-LiA3SHbre6qU1Fs6OvCEj0ZSwGP X-Proofpoint-GUID: 26aK-LiA3SHbre6qU1Fs6OvCEj0ZSwGP X-Proofpoint-Spam-Info: AW1haW4tMjYwODAxMDEzNSBTYWx0ZWRfXwZ8F8LGvAoOm A6S6TDGDbb8llloLQgQb/n09CkHKu7ZzReKA1PiK/8IhktVMV/aSjUnz3DN2X9gWL9Y/4TNHIOd 6bWp9uTBg8I5uBPaYImuznoBgh4oq8g= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwODAxMDEzNSBTYWx0ZWRfX+zndSUCMO4Lc SEW4k7yQgEbQr5NrkirOiFuj9xucLpVERO8sUitfEml+d6i/rIY0z/XYJlrKEaClvcaq1dwg69W 5GauOLl4eV96O35KF99jUMDV+vGfD0uKPqjVdt0XO7RDJZnjXSzXy5e4QTGXMZlnexrw6pmaV5K fm+zNuLv+NEpJ5hPEnVtkHsx/gnYu9/b/9EMhvH7nQGpRqgL/OzrdR8XEp78NA3nZnBF245vlBW IpU7xF7s2ciq+jI3YfGXnersnsxy+MkhiR1XexpZaqSklODhkJ7QBeFF89PSXuALDxHKgPs9Edv Xc3Va8ume+5B1nLzEoKT+8F3Eo9gxX3PUSUZZUtI7fGLnc3z2DUcEpo8/MDo5R3jBR8Do/UJWd+ ab3fxxyEcRWCCpf0BOvSb11LUjy3CbpsOD3Xso47xPafF1dWS88aN2LPaHMkYYmWmJ6o51Gldku Bzg2KZzXO9Wg5UGUfIQ== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-08-01_02,2026-07-30_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 clxscore=1015 lowpriorityscore=0 priorityscore=1501 suspectscore=0 adultscore=0 spamscore=0 malwarescore=0 impostorscore=0 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2608010135 Message-ID-Hash: ZXCWZ3TWS3TVPYY6DKBPON2DT5HC2DAP X-Message-ID-Hash: ZXCWZ3TWS3TVPYY6DKBPON2DT5HC2DAP X-MailFrom: jhkim@linux.ibm.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-devel.lists.libvirt.org-0; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: fiuczy@linux.ibm.com, shalini@linux.ibm.com, Jaehoon Kim , Peter Krempa X-Mailman-Version: 3.3.10 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1785604212235158500 Content-Type: text/plain; charset="utf-8" Add a capability flag for the iothread poll-weight property. Detect support for the property from the QMP schema so that libvirt can conditionally expose and use poll-weight only with QEMU binaries that support it. Signed-off-by: Jaehoon Kim Reviewed-by: Peter Krempa --- src/qemu/qemu_capabilities.c | 2 ++ src/qemu/qemu_capabilities.h | 1 + tests/qemucapabilitiesdata/caps_11.1.0_aarch64.xml | 1 + tests/qemucapabilitiesdata/caps_11.1.0_x86_64.xml | 1 + 4 files changed, 5 insertions(+) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 61e44b398a..d5ebd4a1f7 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -768,6 +768,7 @@ VIR_ENUM_IMPL(virQEMUCaps, /* 495 */ "blockdev-mirror.target-is-zero", /* QEMU_CAPS_BLOCKDEV_MIRR= OR_TARGET_IS_ZERO */ "object-monitor-qmp", /* QEMU_CAPS_OBJECT_MONITOR_QMP */ + "iothread.poll-weight", /* QEMU_CAPS_IOTHREAD_POLL_WEIGHT */ ); =20 =20 @@ -1670,6 +1671,7 @@ static struct virQEMUCapsStringFlags virQEMUCapsQMPSc= hemaQueries[] =3D { { "netdev_add/arg-type/+stream/reconnect-ms", QEMU_CAPS_NETDEV_STREAM_= RECONNECT_MILISECONDS }, { "object-add/arg-type/+sev-guest/kernel-hashes", QEMU_CAPS_SEV_GUEST_= KERNEL_HASHES }, { "object-add/arg-type/+iothread/thread-pool-max", QEMU_CAPS_IOTHREAD_= THREAD_POOL_MAX }, + { "object-add/arg-type/+iothread/poll-weight", QEMU_CAPS_IOTHREAD_POLL= _WEIGHT }, { "query-block/arg-type/flat", QEMU_CAPS_QUERY_BLOCK_FLAT }, { "query-display-options/ret-type/+egl-headless/rendernode", QEMU_CAPS= _EGL_HEADLESS_RENDERNODE }, { "query-display-options/ret-type/+sdl", QEMU_CAPS_SDL }, diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index c846771d50..a4404a5ded 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -742,6 +742,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for = syntax-check */ /* 495 */ QEMU_CAPS_BLOCKDEV_MIRROR_TARGET_IS_ZERO, /* 'blockdev-mirror' support= s 'target-is-zero' */ QEMU_CAPS_OBJECT_MONITOR_QMP, /* 'monitor-qmp' -object */ + QEMU_CAPS_IOTHREAD_POLL_WEIGHT, /* -object iothread.poll-weight */ =20 QEMU_CAPS_LAST /* this must always be the last item */ } virQEMUCapsFlags; diff --git a/tests/qemucapabilitiesdata/caps_11.1.0_aarch64.xml b/tests/qem= ucapabilitiesdata/caps_11.1.0_aarch64.xml index 9e14171d64..0f555665be 100644 --- a/tests/qemucapabilitiesdata/caps_11.1.0_aarch64.xml +++ b/tests/qemucapabilitiesdata/caps_11.1.0_aarch64.xml @@ -188,6 +188,7 @@ + 11000090 61700287 v11.1.0-rc0 diff --git a/tests/qemucapabilitiesdata/caps_11.1.0_x86_64.xml b/tests/qemu= capabilitiesdata/caps_11.1.0_x86_64.xml index e32cedca2f..c1df633822 100644 --- a/tests/qemucapabilitiesdata/caps_11.1.0_x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_11.1.0_x86_64.xml @@ -222,6 +222,7 @@ + 11000090 43100287 v11.1.0-rc0 --=20 2.54.0 From nobody Sat Aug 1 21:31:28 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 38.145.34.151 as permitted sender) client-ip=38.145.34.151; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 38.145.34.151 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=fail(p=reject dis=none) header.from=linux.ibm.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [38.145.34.151]) by mx.zohomail.com with SMTPS id 1785604276109244.7849791814641; Sat, 1 Aug 2026 10:11:16 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 993) id F176D3FCE2; Sat, 1 Aug 2026 13:11:14 -0400 (EDT) Received: from [172.19.199.10] (unknown [10.16.107.18]) by lists.libvirt.org (Postfix) with ESMTP id 1082941C44; Sat, 1 Aug 2026 13:05:08 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 5D9C83F89E; Sat, 1 Aug 2026 13:04:36 -0400 (EDT) Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (3072 bits) server-digest SHA256) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id E6A413F9AC for ; Sat, 1 Aug 2026 13:04:34 -0400 (EDT) Received: from pps.filterd (m0360072.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 671FmpeS1000328 for ; Sat, 1 Aug 2026 17:04:34 GMT Received: from ppma11.dal12v.mail.ibm.com (db.9e.1632.ip4.static.sl-reverse.com [50.22.158.219]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4fs8eu9tnc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Sat, 01 Aug 2026 17:04:34 +0000 (GMT) Received: from pps.filterd (ppma11.dal12v.mail.ibm.com [127.0.0.1]) by ppma11.dal12v.mail.ibm.com (8.18.1.7/8.18.1.7) with ESMTP id 671GuK26022831 for ; Sat, 1 Aug 2026 17:04:33 GMT Received: from smtprelay06.dal12v.mail.ibm.com ([172.16.1.8]) by ppma11.dal12v.mail.ibm.com (PPS) with ESMTPS id 4fna5ymabb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Sat, 01 Aug 2026 17:04:33 +0000 (GMT) Received: from smtpav05.wdc07v.mail.ibm.com (smtpav05.wdc07v.mail.ibm.com [10.39.53.232]) by smtprelay06.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 671H4WCd32768756 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 1 Aug 2026 17:04:32 GMT Received: from smtpav05.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2C2E05805D; Sat, 1 Aug 2026 17:04:32 +0000 (GMT) Received: from smtpav05.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BBB6458059; Sat, 1 Aug 2026 17:04:31 +0000 (GMT) Received: from IBM-GLTZVH3.ibm.com (unknown [9.61.254.33]) by smtpav05.wdc07v.mail.ibm.com (Postfix) with ESMTP; Sat, 1 Aug 2026 17:04:31 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=pp1; bh=YjMIu6TkNilyFrh8L vwdNHMazl6Xp//HvRJ2kx0yIOk=; b=bK8XjWndxNz5pX8D9RM4CmKTQPjANZEPE /CMxzTrm0ZUKbpflBQyjK5uY/ku8kcc4qNkYQGNKbNA3xhCBjNWhcvLTbfUrzeRB +TbGzLEUji2/mnY6UrQUqF9atrCmOcSPOiO40Vtqof22CZZwjHx+xvKOi10JudrK aOAvA96vbhcbaegcVL7ErOSgk8CBQK+ohbBo157QcBlaigHanH2p7fFFJXVY9e3m XiUAFHNn5yXy2ltNiPmJcQBNy+IQONSQ2QVdPjuFccwnUQK1SRg3xy4IzV0o028y sOBOcd+ry5hk1i3HIuzjcmq6sSmbqmUCdYYuIgGKxAfeF7ubNtG/w== From: Jaehoon Kim To: devel@lists.libvirt.org Subject: [PATCH v2 4/7] qemu: add poll-weight getter and stats support Date: Sat, 1 Aug 2026 12:04:22 -0500 Message-ID: <20260801170425.730146-5-jhkim@linux.ibm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260801170425.730146-1-jhkim@linux.ibm.com> References: <20260801170425.730146-1-jhkim@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: ZOkWtp5wsJohjTYfHBM63i4BuFalmI_p X-Proofpoint-Spam-Info: AW1haW4tMjYwODAxMDEzNSBTYWx0ZWRfX6edoAEBWJ+0P SufrthAksQ4gMDF29ZCi6E+a+TVQXdQb6IcVLD/GuoOc1eCrKLM2WJTRRntoZvBwL40cUOe3cx7 ehJT4RlJTY1Dotvp+9HQDqcIFtBj2N8= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwODAxMDEzNSBTYWx0ZWRfX7xoUt5FsNArh XOWZBM7nKI24wWJfKMvx9ApZQqbeqWweeNL0a0Ax9ldiQRHpNAKP4oMTaDSomB6E19HOaXnKb47 CVyi7ft9MXTj5IS54X6e0GRmwk4/KHGuEm4reQ7gwGd7k3yEWuzOFmPN+RWqToOLn64ggXS1BBm zLJuoFUMz0Z4+aUL2crl0Yt4GeyUcbI1RuZ/G7+cIBlegtPbr9CG7H/GDHPv3YbVUM5YCEWnris XW70Lo7y0yG7tbKbyxzahQ2DCAFlMq3HnkuEtrDt+Gn9fGcl9sIbiEQWFE7id6KLNSZqKx0AmCq A+o38dO3yn9OUaA4s4g3vq6aV8qP14X05AvYT+dEX0HFqTDyepn04upTF8CZRd7Svk3e1SvrTSv wNPNuDpDy/+Xxp+Kxjyxg1tRfhVD7LmKysBF4PiCOhfcbVm3urvU0/899IPEpz5vk9sI7Y7qDf1 HvIYO1Ax+sI+l2fOFOw== X-Proofpoint-GUID: ZOkWtp5wsJohjTYfHBM63i4BuFalmI_p X-Authority-Analysis: v=2.4 cv=KfzidwYD c=1 sm=1 tr=0 ts=6a6e2722 cx=c_pps a=aDMHemPKRhS1OARIsFnwRA==:117 a=aDMHemPKRhS1OARIsFnwRA==:17 a=Sv0fKeRqtYgA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22 a=RzCfie-kr_QcCd8fBx8p:22 a=VnNF1IyMAAAA:8 a=-SnnXbuz71o_AxMfTuMA:9 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-08-01_02,2026-07-30_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 bulkscore=0 impostorscore=0 suspectscore=0 malwarescore=0 adultscore=0 clxscore=1015 priorityscore=1501 phishscore=0 spamscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2608010135 Message-ID-Hash: X4UICFG4CAQBF2QKQWQKH5O3XVOZ2KEU X-Message-ID-Hash: X4UICFG4CAQBF2QKQWQKH5O3XVOZ2KEU X-MailFrom: jhkim@linux.ibm.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-devel.lists.libvirt.org-0; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: fiuczy@linux.ibm.com, shalini@linux.ibm.com, Jaehoon Kim X-Mailman-Version: 3.3.10 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1785604276748158500 Content-Type: text/plain; charset="utf-8" Add support for reading the iothread poll-weight value from QEMU and exposing it via domain stats. Add poll_weight and set_poll_weight fields to qemuMonitorIOThreadInfo and parse the poll-weight property from the QMP query-iothreads response. The property is optional and only present on newer QEMU binaries. Expose the fetched value through the domain stats interface by adding VIR_DOMAIN_STATS_IOTHREAD_SUFFIX_POLL_WEIGHT and reporting it in qemuDomainGetStatsIOThread when the value is available. Signed-off-by: Jaehoon Kim --- docs/manpages/virsh.rst | 2 ++ include/libvirt/libvirt-domain.h | 10 ++++++++++ src/qemu/qemu_driver.c | 5 +++++ src/qemu/qemu_monitor.h | 2 ++ src/qemu/qemu_monitor_json.c | 5 +++++ 5 files changed, 24 insertions(+) diff --git a/docs/manpages/virsh.rst b/docs/manpages/virsh.rst index a10d29e0ea..8465f19c12 100644 --- a/docs/manpages/virsh.rst +++ b/docs/manpages/virsh.rst @@ -2905,6 +2905,8 @@ not available for statistical purposes. growth is managed by the hypervisor. * ``iothread..poll-shrink`` - polling time shrink value. A value of (zero) indicates shrink is managed by hypervisor. +* ``iothread..poll-weight`` - polling weight shift value. A value of 0 + (zero) indicates the hypervisor's default weight is used. =20 *--memory* returns: =20 diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-dom= ain.h index f4dfe9fb1a..bb524f41ee 100644 --- a/include/libvirt/libvirt-domain.h +++ b/include/libvirt/libvirt-domain.h @@ -4330,6 +4330,16 @@ struct _virDomainStatsRecord { */ # define VIR_DOMAIN_STATS_IOTHREAD_SUFFIX_POLL_SHRINK ".poll-shrink" =20 +/** + * VIR_DOMAIN_STATS_IOTHREAD_SUFFIX_POLL_WEIGHT: + * + * Polling weight factor as an unsigned int. This shift value controls how + * much the most recent event interval affects adaptive polling calculatio= ns. + * A 0 (zero) indicates the hypervisor's default weight is used. + * + * Since: 12.7.0 + */ +# define VIR_DOMAIN_STATS_IOTHREAD_SUFFIX_POLL_WEIGHT ".poll-weight" =20 /** * VIR_DOMAIN_STATS_MEMORY_BANDWIDTH_MONITOR_COUNT: diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 44b41726fb..842b56a2c2 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -18411,6 +18411,11 @@ qemuDomainGetStatsIOThread(virQEMUDriver *driver G= _GNUC_UNUSED, VIR_DOMAIN_STATS_IOTHREAD_PREFIX = "%u" VIR_DOMAIN_STATS_IOTHREAD_SUFFIX_POLL_SHRINK, iothreads[i]->iothread_id); } + if (iothreads[i]->set_poll_weight) { + virTypedParamListAddUInt(params, iothreads[i]->poll_weight, + VIR_DOMAIN_STATS_IOTHREAD_PREFIX "%u"= VIR_DOMAIN_STATS_IOTHREAD_SUFFIX_POLL_WEIGHT, + iothreads[i]->iothread_id); + } } =20 for (i =3D 0; i < niothreads; i++) diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h index 3298095e9c..e560618bf4 100644 --- a/src/qemu/qemu_monitor.h +++ b/src/qemu/qemu_monitor.h @@ -1583,11 +1583,13 @@ struct _qemuMonitorIOThreadInfo { unsigned long long poll_max_ns; unsigned long long poll_grow; unsigned long long poll_shrink; + unsigned int poll_weight; int thread_pool_min; int thread_pool_max; bool set_poll_max_ns; bool set_poll_grow; bool set_poll_shrink; + bool set_poll_weight; bool set_thread_pool_min; bool set_thread_pool_max; }; diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index af9a77ed3b..b02c0722d9 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -7202,6 +7202,11 @@ qemuMonitorJSONGetIOThreads(qemuMonitor *mon, virJSONValueObjectGetNumberUlong(child, "poll-shrink", &info->poll_shrink) =3D=3D 0) info->poll_valid =3D true; + + /* poll-weight is optional, only present on newer QEMU */ + if (virJSONValueObjectGetNumberUint(child, "poll-weight", + &info->poll_weight) =3D=3D 0) + info->set_poll_weight =3D true; } =20 *niothreads =3D n; --=20 2.54.0 From nobody Sat Aug 1 21:31:28 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 38.145.34.151 as permitted sender) client-ip=38.145.34.151; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 38.145.34.151 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=fail(p=reject dis=none) header.from=linux.ibm.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [38.145.34.151]) by mx.zohomail.com with SMTPS id 1785604485728443.9495744318998; Sat, 1 Aug 2026 10:14:45 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 73603417EF; Sat, 1 Aug 2026 13:14:44 -0400 (EDT) Received: from [172.19.199.10] (unknown [10.16.107.18]) by lists.libvirt.org (Postfix) with ESMTP id 6A4A93FD29; Sat, 1 Aug 2026 13:05:18 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 993) id EDF0B3FACE; Sat, 1 Aug 2026 13:04:41 -0400 (EDT) Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (3072 bits) server-digest SHA256) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id AA5823F89E for ; Sat, 1 Aug 2026 13:04:36 -0400 (EDT) Received: from pps.filterd (m0360083.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 671FlecW936555 for ; Sat, 1 Aug 2026 17:04:35 GMT Received: from ppma11.dal12v.mail.ibm.com (db.9e.1632.ip4.static.sl-reverse.com [50.22.158.219]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4fs8a3hxdd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Sat, 01 Aug 2026 17:04:35 +0000 (GMT) Received: from pps.filterd (ppma11.dal12v.mail.ibm.com [127.0.0.1]) by ppma11.dal12v.mail.ibm.com (8.18.1.7/8.18.1.7) with ESMTP id 671GuJf2022794 for ; Sat, 1 Aug 2026 17:04:34 GMT Received: from smtprelay07.dal12v.mail.ibm.com ([172.16.1.9]) by ppma11.dal12v.mail.ibm.com (PPS) with ESMTPS id 4fna5ymabk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Sat, 01 Aug 2026 17:04:34 +0000 (GMT) Received: from smtpav05.wdc07v.mail.ibm.com (smtpav05.wdc07v.mail.ibm.com [10.39.53.232]) by smtprelay07.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 671H4XkN18350654 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 1 Aug 2026 17:04:33 GMT Received: from smtpav05.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5742158053; Sat, 1 Aug 2026 17:04:33 +0000 (GMT) Received: from smtpav05.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D2B2C5805D; Sat, 1 Aug 2026 17:04:32 +0000 (GMT) Received: from IBM-GLTZVH3.ibm.com (unknown [9.61.254.33]) by smtpav05.wdc07v.mail.ibm.com (Postfix) with ESMTP; Sat, 1 Aug 2026 17:04:32 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=pp1; bh=QKGpiY/CU2QlcyvVB FhZqzzNR7TGAp+qxZ85Ypx3Yv4=; b=Bf1J3HQMBVSGOnnuaQQjC7kC0uCzT/Uoo RmalQVO6x4/39+BqjkC7UvjuYC+qUvkcInuHY4xHNIbFGbHAyI5L0Hd4yxoNj5Zp Yx3mv6tGnvxXdrQBfJOFRjIjQsbWXkaSfEs4jOV9Yvx1OOAQn06y9QbsXJWOdLsk 8wLCk0TbOjl1SDc1PaoSifSXdnyd7xsKNZ+Fge51D8xIH/cPu89HyaBFFXI5/8ZI mbokGByW7kubcDN5rDg9bFNUgiwBs4atTXlwHJQKeHPY9obxhls6GaxwUy1PbiN2 MH7oLpXPGS5V+l8YKg8VJPx0ZgkSZSRyXEZhuzEchhXHcasjl3+Ug== From: Jaehoon Kim To: devel@lists.libvirt.org Subject: [PATCH v2 5/7] qemu: support iothread poll-weight Date: Sat, 1 Aug 2026 12:04:23 -0500 Message-ID: <20260801170425.730146-6-jhkim@linux.ibm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260801170425.730146-1-jhkim@linux.ibm.com> References: <20260801170425.730146-1-jhkim@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Authority-Analysis: v=2.4 cv=E6P9Y6dl c=1 sm=1 tr=0 ts=6a6e2723 cx=c_pps a=aDMHemPKRhS1OARIsFnwRA==:117 a=aDMHemPKRhS1OARIsFnwRA==:17 a=Sv0fKeRqtYgA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22 a=iQ6ETzBq9ecOQQE5vZCe:22 a=VnNF1IyMAAAA:8 a=Uug0q60SRhg2c1jWztAA:9 a=VFWdiVo8ruoyLSY_:21 X-Proofpoint-ORIG-GUID: D5fpBRN1RadTmk_VCo18kErWtvx8263M X-Proofpoint-GUID: D5fpBRN1RadTmk_VCo18kErWtvx8263M X-Proofpoint-Spam-Info: AW1haW4tMjYwODAxMDEzNSBTYWx0ZWRfX2sq4IFcVf4Xb BFO4X1WuR55HechNGj1zPDPX4zI8rZwh0VaqFwlWlFV2AJ27aYswenvqHMiKJr3oHRJ0n8toJiB 6yTqbJ/OT0GHUdcmJC0h/59MlPT87hQ= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwODAxMDEzNSBTYWx0ZWRfX9Eb3UFWZhd1i fx9jeq3WI/9ETak7M3nldGSCZHQ02uD7uWI0tX9sU2bVi32wWbWlNKkVg1rVDSGBW242v0j/46f 0BcQKCPYNrVmhTk8/6Sa7/wi5aYGzygz3mOcqY9ZUzonm9v9Vqg2lxk8HWosw69yFQlLPaOZVpN WwNM0ko8baOQ11wq6A8sMHi4vWpbUYjQRI+BHElimEItCaFHelLgUa7nZjKEQMFPonRnuqPNXKG Ubrw0EPAqNDPgMOSFvHBNCwfQSO8AWFY1aK1BtE1bsAcXrHQ7Tbi9Qtfr7QVUwHHhaIEqGlo4j6 CjrKOLAq0iSlnVzQ66OyxTW2k0z4aCX977njJAAVORBSwvPRuCDjJ6hZm/PE6CP8zdiyUyiWO91 6dszJsgMXMvmI920jJjOS2dNBhTnpLAVNlEojaYbCLZflta8NfYU0mAevwIJJUD3Wk29OnmOVl9 TQolQjpFr6wpotCICXg== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-08-01_02,2026-07-30_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 clxscore=1015 lowpriorityscore=0 priorityscore=1501 suspectscore=0 adultscore=0 spamscore=0 malwarescore=0 impostorscore=0 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2608010135 Message-ID-Hash: 5LNDVY7KO2VXY7VPX2VQH32LGBENPNEQ X-Message-ID-Hash: 5LNDVY7KO2VXY7VPX2VQH32LGBENPNEQ X-MailFrom: jhkim@linux.ibm.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-devel.lists.libvirt.org-0; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: fiuczy@linux.ibm.com, shalini@linux.ibm.com, Jaehoon Kim X-Mailman-Version: 3.3.10 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1785604487500158500 Content-Type: text/plain; charset="utf-8" Wire the poll-weight setting into the QEMU command line, monitor, and driver-side parameter handling. Add poll-weight to the iothread object properties when building the QEMU command line. Add the live setter in the monitor JSON layer using a new VIR_IOTHREAD_SET_PROP_UINT macro consistent with the existing UL variant. Wire up typed parameter parsing with an explicit range check for [0, 63] and propagate the value into the persistent domain definition on hotplug. Guard the live path with a capability check. Add a CAPS check in the domain validator and remove the now-unnecessary break from the thread pool validation loop since the loop must continue to check poll-weight on every iothread. Also add VIR_DOMAIN_IOTHREAD_POLL_WEIGHT typed parameter constant and a qemuxmlconf test case for the new functionality. Signed-off-by: Jaehoon Kim --- include/libvirt/libvirt-domain.h | 15 +++++ src/qemu/qemu_command.c | 6 ++ src/qemu/qemu_driver.c | 33 +++++++++++ src/qemu/qemu_monitor_json.c | 13 +++++ src/qemu/qemu_validate.c | 10 +++- ...s-poll-weight-outofrange.x86_64-latest.err | 1 + .../iothreads-ids-poll-weight-outofrange.xml | 58 +++++++++++++++++++ ...threads-ids-poll-weight.x86_64-latest.args | 40 +++++++++++++ ...othreads-ids-poll-weight.x86_64-latest.xml | 58 +++++++++++++++++++ .../iothreads-ids-poll-weight.xml | 58 +++++++++++++++++++ tests/qemuxmlconftest.c | 2 + 11 files changed, 292 insertions(+), 2 deletions(-) create mode 100644 tests/qemuxmlconfdata/iothreads-ids-poll-weight-outofra= nge.x86_64-latest.err create mode 100644 tests/qemuxmlconfdata/iothreads-ids-poll-weight-outofra= nge.xml create mode 100644 tests/qemuxmlconfdata/iothreads-ids-poll-weight.x86_64-= latest.args create mode 100644 tests/qemuxmlconfdata/iothreads-ids-poll-weight.x86_64-= latest.xml create mode 100644 tests/qemuxmlconfdata/iothreads-ids-poll-weight.xml diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-dom= ain.h index bb524f41ee..33dc700755 100644 --- a/include/libvirt/libvirt-domain.h +++ b/include/libvirt/libvirt-domain.h @@ -2748,6 +2748,21 @@ int virDomainDelIOThread(virDomainP= tr domain, */ # define VIR_DOMAIN_IOTHREAD_POLL_SHRINK "poll_shrink" =20 +/** + * VIR_DOMAIN_IOTHREAD_POLL_WEIGHT: + * + * This provides a shift value for the adaptive polling algorithm to contr= ol + * how much the most recent event interval affects the next polling durati= on + * calculation. Larger values decrease the weight of the current interval, + * enabling more gradual adjustments. Valid range is [0, 63]. A value of 0 + * lets the hypervisor select a default weight. + * + * Accepted type is VIR_TYPED_PARAM_UINT. + * + * Since: 12.7.0 + */ +# define VIR_DOMAIN_IOTHREAD_POLL_WEIGHT "poll_weight" + /** * VIR_DOMAIN_IOTHREAD_THREAD_POOL_MIN: * diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index a76a034158..19c57eb09a 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -7687,6 +7687,12 @@ qemuBuildIOThreadCommandLine(virCommand *cmd, NULL) < 0) return -1; =20 + if (iothread->set_poll_weight && + virJSONValueObjectAdd(&props, + "u:poll-weight", iothread->poll_weight, + NULL) < 0) + return -1; + if (qemuBuildObjectCommandlineFromJSON(cmd, props) < 0) return -1; } diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 842b56a2c2..e973c91efd 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -5292,6 +5292,11 @@ qemuDomainHotplugModIOThreadIDDef(virDomainIOThreadI= DDef *def, def->set_poll_shrink =3D true; } =20 + if (mondef.set_poll_weight) { + def->poll_weight =3D mondef.poll_weight; + def->set_poll_weight =3D true; + } + if (mondef.set_thread_pool_min) def->thread_pool_min =3D mondef.thread_pool_min; =20 @@ -5384,6 +5389,11 @@ qemuDomainHotplugDelIOThread(virDomainObj *vm, * necessary. If a 0 (zero) value is provided, QEMU resets the polling * interval to 0 (zero) allowing the poll-grow to manipulate the time. * + * - "poll-weight" - weight shift value used by the adaptive polling algor= ithm + * to determine how much the most recent event interval influences the + * next interval calculation. Accepted range is [0, 63]. If a 0 (zero) + * value is provided, QEMU uses its default weight. + * * QEMU keeps track of the polling time elapsed and may grow or shrink the * its polling interval based upon its heuristic algorithm. It is possible * that calculations determine that it has found a "sweet spot" and no @@ -5419,6 +5429,20 @@ qemuDomainIOThreadParseParams(virTypedParameterPtr p= arams, if (rc =3D=3D 1) iothread->set_poll_shrink =3D true; =20 + if ((rc =3D virTypedParamsGetUInt(params, nparams, + VIR_DOMAIN_IOTHREAD_POLL_WEIGHT, + &iothread->poll_weight)) < 0) + return -1; + if (rc =3D=3D 1) { + if (iothread->poll_weight > 63) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("poll-weight value %1$u is out of range [0, 6= 3]"), + iothread->poll_weight); + return -1; + } + iothread->set_poll_weight =3D true; + } + if ((rc =3D virTypedParamsGetInt(params, nparams, VIR_DOMAIN_IOTHREAD_THREAD_POOL_MIN, &iothread->thread_pool_min)) < 0) @@ -5617,6 +5641,13 @@ qemuDomainChgIOThread(virQEMUDriver *driver, if (qemuDomainIOThreadValidate(iothreaddef, iothread, true) < = 0) goto endjob; =20 + if (iothread.set_poll_weight && + !virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_IOTHREAD_POLL_WE= IGHT)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("poll-weight is not supported by this QEM= U binary")); + goto endjob; + } + if (qemuDomainHotplugModIOThread(vm, iothread) < 0) goto endjob; =20 @@ -5747,6 +5778,8 @@ qemuDomainSetIOThreadParams(virDomainPtr dom, VIR_TYPED_PARAM_UNSIGNED, VIR_DOMAIN_IOTHREAD_POLL_SHRINK, VIR_TYPED_PARAM_UNSIGNED, + VIR_DOMAIN_IOTHREAD_POLL_WEIGHT, + VIR_TYPED_PARAM_UINT, VIR_DOMAIN_IOTHREAD_THREAD_POOL_MIN, VIR_TYPED_PARAM_INT, VIR_DOMAIN_IOTHREAD_THREAD_POOL_MAX, diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index b02c0722d9..7e3249cd47 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -7248,6 +7248,19 @@ qemuMonitorJSONSetIOThread(qemuMonitor *mon, =20 #undef VIR_IOTHREAD_SET_PROP_UL =20 +#define VIR_IOTHREAD_SET_PROP_UINT(propName, propVal) \ + if (iothreadInfo->set_##propVal) { \ + memset(&prop, 0, sizeof(prop)); \ + prop.type =3D QEMU_MONITOR_OBJECT_PROPERTY_UINT; \ + prop.val.ui =3D iothreadInfo->propVal; \ + if (qemuMonitorJSONSetObjectProperty(mon, path, propName, &prop) <= 0) \ + return -1; \ + } + + VIR_IOTHREAD_SET_PROP_UINT("poll-weight", poll_weight); + +#undef VIR_IOTHREAD_SET_PROP_UINT + if (iothreadInfo->set_thread_pool_min && iothreadInfo->set_thread_pool_max) { int curr_max =3D -1; diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index ae1edf435a..40be2e957e 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -500,9 +500,15 @@ qemuValidateDomainDefIOThreads(const virDomainDef *def, for (i =3D 0; i < def->niothreadids; i++) { virDomainIOThreadIDDef *iothread =3D def->iothreadids[i]; =20 - if (iothread->thread_pool_min !=3D -1 || iothread->thread_pool_max= !=3D -1) { + if (iothread->thread_pool_min !=3D -1 || iothread->thread_pool_max= !=3D -1) needsThreadPoolCap =3D true; - break; + + /* poll-weight requires QEMU_CAPS_IOTHREAD_POLL_WEIGHT */ + if (iothread->set_poll_weight && + !virQEMUCapsGet(qemuCaps, QEMU_CAPS_IOTHREAD_POLL_WEIGHT)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("poll-weight is not supported by this QEMU bi= nary")); + return -1; } } =20 diff --git a/tests/qemuxmlconfdata/iothreads-ids-poll-weight-outofrange.x86= _64-latest.err b/tests/qemuxmlconfdata/iothreads-ids-poll-weight-outofrange= .x86_64-latest.err new file mode 100644 index 0000000000..d3dbab3e50 --- /dev/null +++ b/tests/qemuxmlconfdata/iothreads-ids-poll-weight-outofrange.x86_64-lat= est.err @@ -0,0 +1 @@ +unsupported configuration: poll weight 64 is out of range [0, 63] diff --git a/tests/qemuxmlconfdata/iothreads-ids-poll-weight-outofrange.xml= b/tests/qemuxmlconfdata/iothreads-ids-poll-weight-outofrange.xml new file mode 100644 index 0000000000..26bbd8ee45 --- /dev/null +++ b/tests/qemuxmlconfdata/iothreads-ids-poll-weight-outofrange.xml @@ -0,0 +1,58 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219136 + 219136 + 4 + 4 + + + + + + + + + + + + + + + + hvm + + + + qemu64 + + + destroy + restart + destroy + + /usr/bin/qemu-system-x86_64 + + + + +
+ + + + +
+ + +
+ + +
+ + + +