[PATCH v6 18/18] tests: Test qemuxmlactivetestThrottleGroup

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* updated latest 11.0.0, qemu gitlab url, documents and change requests

signed-off-by: Harikumar R <harirajkumar230@xxxxxxxxx>
---
 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
 ------------------------------
 
-:since:`Since 10.7.0` it is possible to create multiple named throttle groups
+:since:`Since 11.0.0` it is possible to create multiple named throttle groups
 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 provide 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 for each one
    and we also want to limit combined I/O of all four disks, we can leverage
    ``throttlefilters`` to achieve this goal by setting two ``throttlefilter`` 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
 
-
+/* the field changes must also be applied to the other function that formats
+ * the <disk> throttling definition virDomainThrottleGroupFormat. */
 #define PARSE_THROTTLEGROUP(val) \
     if (virXPathULongLong("string(./" #val ")", \
                           ctxt, &group->val) == -2) { \
@@ -7952,8 +7953,10 @@ virDomainDefThrottleGroupsParse(virDomainDef *def,
     if ((n = virXPathNodeSet("./throttlegroups/throttlegroup", ctxt, &nodes)) < 0)
         return -1;
 
-    if (n)
-        def->throttlegroups = g_new0(virDomainThrottleGroupDef *, n);
+    if (n == 0)
+        return 0;
+
+    def->throttlegroups = g_new0(virDomainThrottleGroupDef *, n);
 
     for (i = 0; i < n; i++) {
         g_autoptr(virDomainThrottleGroupDef) group = 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);
 }
 
-
+/*
+ * the field changes must also be applied to the other function that parses
+ * the <disk> throttling definition virDomainThrottleGroupDefParseXML
+ */
 #define FORMAT_THROTTLE_GROUP(val) \
         if (group->val > 0) { \
             virBufferAsprintf(&childBuf, "<" #val ">%llu</" #val ">\n", \
@@ -27990,6 +27995,8 @@ virDomainThrottleGroupFormat(virBuffer *buf,
     FORMAT_THROTTLE_GROUP(read_iops_sec_max);
     FORMAT_THROTTLE_GROUP(write_iops_sec_max);
 
+    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 = VIR_BUFFER_INIT_CHILD(buf);
-    ssize_t n;
+    size_t n;
 
     for (n = 0; n < def->nthrottlegroups; n++) {
         virDomainThrottleGroupFormat(&childrenBuf, def->throttlegroups[n]);
-- 
2.39.5 (Apple Git-154)



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux