From nobody Sat Jan 4 23:22:05 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; 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 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1733751230586663.1797176921723; Mon, 9 Dec 2024 05:33:50 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id 64F541276; Mon, 9 Dec 2024 08:33:49 -0500 (EST) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 4940E1447; Mon, 9 Dec 2024 08:20:32 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id C48C911D0; Mon, 9 Dec 2024 07:43:04 -0500 (EST) Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 08FC2BC4 for ; Mon, 9 Dec 2024 07:43:04 -0500 (EST) Received: by mail-pl1-f177.google.com with SMTP id d9443c01a7336-2163bd70069so12311845ad.0 for ; Mon, 09 Dec 2024 04:43:03 -0800 (PST) Received: from localhost.localdomain ([120.60.110.156]) by smtp.googlemail.com with ESMTPSA id d9443c01a7336-2164d103993sm18113195ad.193.2024.12.09.04.43.00 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 09 Dec 2024 04:43:01 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1733748182; x=1734352982; darn=lists.libvirt.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=kB8OJvhU4Tf285qlNABkvK5BAms7TtOlbxvRnSPFdCo=; b=RWWF9K8EJl+x6VPKKPvOhDTA9hgn+yxnh2LgBziZ7ZkwT68z2BUiK3bAQyhuUseRi6 DZbu4EpvE99kR3vlMGnqoAEStMe7MdcHi/wJM0WHNPa81KlFTfwTIFgaGktx8RWzICx+ KHmCt3+ZSP2uHAeZ/TqlUHlOE2lsD80TTbetlx9kpqxNj+AiahIaciE7fHun7v1uwICW a9OKrMjbQR/tq1MGVOpD28U7LAQsHD83adYEuIFTBnHgQb2qXGWQgCia/9t3XHdQ7yqx 5+CfbdTptaQx/B7uYx0X5VKj2qltazt9wRXuuLfENhx+RM+cvHqqbzISNTgdYR+BNtPg RpyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733748182; x=1734352982; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=kB8OJvhU4Tf285qlNABkvK5BAms7TtOlbxvRnSPFdCo=; b=cv00Eh3+Eq8XA5mPdUm/lh5hkd9EpmjRV+2TjTEoud7pTOOimHE5a6owPUJ9FjARP7 bEgekHK7DyO+Cb4P+8YBSZPtfW2dQBAdaKsssdZku+MVJKUsey62B1udwWzx5liLuxyG 09CSSylUp9S6pws3mECVdIsWPgWx7XzOB67SER6YwY51JDOJdzVZdlanvTGbZ+nMvRig fD4AajYP2UjeR6D6Zbjr2PD96ecR/EdX+VFjcI9qSZxEEEcw0Hfwf3k+St6PKvEARIZq zP7cb6jMb0EgByx158mr2EuHBpY7APA5XVQYccr/wUNKDwsTbnYmIzAMvAxpA/d8+Mu0 k+sA== X-Gm-Message-State: AOJu0Yxb+Ho76Q/4OgNSrAN5QaUSikWW2StJOn8CP9Oalmed0RCK6PGs cnhVswjN6HWBIGMGqytGvYEjsDWGdN+LQkwXvAu2/A24t3esEpHZXNcOWjx2 X-Gm-Gg: ASbGncvzc8alkOG5bZ05KgwJ4Czf9ZAhwufbA8raSwesNGfnWUj/WLorC3DVZ1KAx3g R2xJTqL/b1zNtBQDCB79aLqI7xHjnLMnBanqgLufnvxtIsfuqL/46wGpGOKxM+aNidxh16smHNl sty1aA6VYYQNlFa/srhFzeqgR2rS/nLaUX2K00FLQRYuA7EbzPlXWheKrzxt4HU/kWikNHAXce1 j4XaPeYHmooDWFj6FqmBgYaZNqkvPjFegwq3/cXDjiuG2BBFFjEgy+U8mxz39c+mItHvvbG7P3D akKCFg== X-Google-Smtp-Source: AGHT+IE9GlJHgAAUSdUV6VOFHNt9LTlcuI8zQjZJOY0whPzVszHTK4Av3GM1U+0aV/3NLc+Vl85dHA== X-Received: by 2002:a17:902:ce86:b0:215:a3fd:61f5 with SMTP id d9443c01a7336-21669fc6945mr5824365ad.5.1733748182121; Mon, 09 Dec 2024 04:43:02 -0800 (PST) From: Harikumar R To: devel@lists.libvirt.org Subject: [PATCH v6 18/18] tests: Test qemuxmlactivetestThrottleGroup Date: Mon, 9 Dec 2024 18:11:18 +0530 Message-Id: <20241209124118.39471-19-harirajkumar230@gmail.com> X-Mailer: git-send-email 2.39.5 (Apple Git-154) In-Reply-To: <20241209124118.39471-1-harirajkumar230@gmail.com> References: <20241209124118.39471-1-harirajkumar230@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-MailFrom: harirajkumar230@gmail.com X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0 Message-ID-Hash: 2FCIGZDOYWBS2U4K5ZO7WMLCOEB6L2UW X-Message-ID-Hash: 2FCIGZDOYWBS2U4K5ZO7WMLCOEB6L2UW X-Mailman-Approved-At: Mon, 09 Dec 2024 13:19:50 -0500 CC: earulana@in.ibm.com, sanjeev.ranjan@ibm.com, harikumar.rajkumar@ibm.com, Harikumar R X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1733751231753116600 Content-Type: text/plain; charset="utf-8" * updated latest 11.0.0, qemu gitlab url, documents and change requests signed-off-by: Harikumar R --- docs/formatdomain.rst | 4 ++-- src/conf/domain_conf.c | 31 +++++++++++++++++++------------ 2 files changed, 21 insertions(+), 14 deletions(-) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index 84aa5d85ac..276fa218c0 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -1967,7 +1967,7 @@ advertisements to the guest OS. (NB: Only qemu driver= support) Disk Throttle Group Management ------------------------------ =20 -:since:`Since 10.7.0` it is possible to create multiple named throttle gro= ups +:since:`Since 11.0.0` it is possible to create multiple named throttle gro= ups and then reference them within ``throttlefilters``(sub-element of ``disk``= element) to form filter chain in QEMU for specific disk. The limits(throttlegroups)= are shared within domain, hence the same group can be referenced by different = filters. @@ -3285,7 +3285,7 @@ paravirtualized driver is specified via the ``disk`` = element. "rotation_rate" attribute value :since:`since 7.3.0` ``throttlefilters`` The optional ``throttlefilters`` element provides the ability to provid= e additional - per-device throttle chain :since:`Since 10.7.0` + per-device throttle chain :since:`Since 11.0.0` For example, if we have four different disks and we want to limit I/O f= or each one and we also want to limit combined I/O of all four disks, we can levera= ge ``throttlefilters`` to achieve this goal by setting two ``throttlefilte= r`` for diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index a4de5c01c3..01b6d4fc9f 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -7859,7 +7859,8 @@ virDomainDiskDefIotuneParse(virDomainDiskDef *def, } #undef PARSE_IOTUNE =20 - +/* the field changes must also be applied to the other function that forma= ts + * the throttling definition virDomainThrottleGroupFormat. */ #define PARSE_THROTTLEGROUP(val) \ if (virXPathULongLong("string(./" #val ")", \ ctxt, &group->val) =3D=3D -2) { \ @@ -7952,8 +7953,10 @@ virDomainDefThrottleGroupsParse(virDomainDef *def, if ((n =3D virXPathNodeSet("./throttlegroups/throttlegroup", ctxt, &no= des)) < 0) return -1; =20 - if (n) - def->throttlegroups =3D g_new0(virDomainThrottleGroupDef *, n); + if (n =3D=3D 0) + return 0; + + def->throttlegroups =3D g_new0(virDomainThrottleGroupDef *, n); =20 for (i =3D 0; i < n; i++) { g_autoptr(virDomainThrottleGroupDef) group =3D NULL; @@ -22648,7 +22651,9 @@ virDomainIOThreadIDDel(virDomainDef *def, * @src: throttle group to be copiped from * @dst: throttle group to be copiped to * - * copy throttle group content from @src to @dst + * copy throttle group content from @src to @dst, + * this function does not allocate memory for @dst - the caller must ensure + * @dst is already allocated before calling this function. */ void virDomainThrottleGroupDefCopy(const virDomainThrottleGroupDef *src, @@ -22684,9 +22689,8 @@ virDomainThrottleGroupAdd(virDomainDef *def, * @def: domain definition * @info: throttle group definition within domain * - * search existing throttle group within domain definition - * by group_name and then overwrite it with @info, - * it's to update existing throttle group + * Update corresponding throttle group in @def using new config @info. If a + * throttle group with given name doesn't exist this function does nothing. */ void virDomainThrottleGroupUpdate(virDomainDef *def, @@ -22713,9 +22717,7 @@ virDomainThrottleGroupUpdate(virDomainDef *def, * @def: domain definition * @name: throttle group name * - * search existing throttle group within domain definition - * by group_name and then delete it with @name, - * it's to delete existing throttle group + * Delete throttle group @name in @def */ void virDomainThrottleGroupDel(virDomainDef *def, @@ -27962,7 +27964,10 @@ virDomainDefIOThreadsFormat(virBuffer *buf, virDomainDefaultIOThreadDefFormat(buf, def); } =20 - +/* + * the field changes must also be applied to the other function that parses + * the throttling definition virDomainThrottleGroupDefParseXML + */ #define FORMAT_THROTTLE_GROUP(val) \ if (group->val > 0) { \ virBufferAsprintf(&childBuf, "<" #val ">%llu\n", \ @@ -27990,6 +27995,8 @@ virDomainThrottleGroupFormat(virBuffer *buf, FORMAT_THROTTLE_GROUP(read_iops_sec_max); FORMAT_THROTTLE_GROUP(write_iops_sec_max); =20 + FORMAT_THROTTLE_GROUP(size_iops_sec); + FORMAT_THROTTLE_GROUP(total_bytes_sec_max_length); FORMAT_THROTTLE_GROUP(read_bytes_sec_max_length); FORMAT_THROTTLE_GROUP(write_bytes_sec_max_length); @@ -28010,7 +28017,7 @@ virDomainDefThrottleGroupsFormat(virBuffer *buf, const virDomainDef *def) { g_auto(virBuffer) childrenBuf =3D VIR_BUFFER_INIT_CHILD(buf); - ssize_t n; + size_t n; =20 for (n =3D 0; n < def->nthrottlegroups; n++) { virDomainThrottleGroupFormat(&childrenBuf, def->throttlegroups[n]); --=20 2.39.5 (Apple Git-154)