]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
schema: Add new domain elements to support multiple throttle filters
authorChun Feng Wu <danielwuwy@163.com>
Wed, 19 Feb 2025 16:57:06 +0000 (22:27 +0530)
committerPeter Krempa <pkrempa@redhat.com>
Thu, 20 Mar 2025 16:43:42 +0000 (17:43 +0100)
Introduce schema for defining '<throttlefilters>' element which
references throttling groups to form filter chain in qemu for specific
disk

* Add new elements '<throttlefilters>'
* <ThrottleFilters> can include multiple throttlegroup references to
  form filter chain in qemu
* Chained throttle filters feature in qemu is described at
  https://gitlab.com/qemu-project/qemu/blob/master/docs/throttle.txt

Signed-off-by: Chun Feng Wu <danielwuwy@163.com>
Signed-off-by: Harikumar Rajkumar <harirajkumar230@gmail.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
docs/formatdomain.rst
src/conf/schemas/domaincommon.rng

index b55bc88a5229aedae64be07fecc646bbea626d2a..aae58fab600c7f96132d99d910fee4a4e728157c 100644 (file)
@@ -2819,6 +2819,15 @@ paravirtualized driver is specified via the ``disk`` element.
        </backingStore>
        <target dev='vdh' bus='virtio'/>
      </disk>
+     <disk type='file' device='disk'>
+       <driver name='qemu' type='qcow2' />
+       <source file='/var/lib/libvirt/images/disk.qcow2'/>
+       <target dev='vdh' bus='virtio'/>
+       <throttlefilters>
+         <throttlefilter group='limit2'/>
+         <throttlefilter group='limit012'/>
+       </throttlefilters>
+     </disk>
    </devices>
    ...
 
@@ -3321,6 +3330,18 @@ paravirtualized driver is specified via the ``disk`` element.
    :since:`since after 0.4.4`; "sata" attribute value :since:`since 0.9.7`;
    "removable" attribute value :since:`since 1.1.3`;
    "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 11.2.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
+   each disk: disk's own filter(e.g. limit2) and combined filter(e.g. limit012).
+   The order of such ``throttlefilter`` doesn't matter within ``throttlefilters``.
+   ``throttlefilters`` and ``iotune`` should be used exclusively.
+
+   ``throttlefilter``
+      The optional ``throttlefilter`` element is to reference defined throttle group.
 ``iotune``
    The optional ``iotune`` element provides the ability to provide additional
    per-device I/O tuning, with values that can vary for each device (contrast
index c2c9662dc7f0482ed1e38ab3bfdc4e4e2f18ddb3..8bf909e6fb249a9543c834eb6e9afa18e54625cc 100644 (file)
         <ref name="encryption"/>
       </optional>
       <optional>
-        <ref name="diskIoTune"/>
+        <choice>
+          <ref name="throttlefilters"/>
+          <ref name="diskIoTune"/>
+        </choice>
       </optional>
       <optional>
         <ref name="alias"/>
       </element>
     </optional>
   </define>
+  <!--
+      A set of throttlefilters to reference throttlegroups
+    -->
+  <define name="throttlefilters">
+    <element name="throttlefilters">
+      <zeroOrMore>
+        <element name="throttlefilter">
+          <attribute name="group">
+            <data type="string"/>
+          </attribute>
+        </element>
+      </zeroOrMore>
+    </element>
+  </define>
   <!--
       A set of optional features: PAE, APIC, ACPI, GIC, TCG,
       HyperV Enlightenment, KVM features, paravirtual spinlocks and HAP support