On Tue, Jul 02, 2024 at 16:11:03 +0200, Peter Krempa wrote: > On Wed, Jun 12, 2024 at 03:02:10 -0700, wucf@xxxxxxxxxxxxx wrote: > > From: Chun Feng Wu <wucf@xxxxxxxxxxxxx> > > > > * 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://github.com/qemu/qemu/blob/master/docs/throttle.txt > > > > Signed-off-by: Chun Feng Wu <wucf@xxxxxxxxxxxxx> > > --- > > docs/formatdomain.rst | 22 ++++++++++++++++++++++ > > src/conf/schemas/domaincommon.rng | 19 ++++++++++++++++++- > > 2 files changed, 40 insertions(+), 1 deletion(-) > > > > diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst > > index b7e1f9cc83..0fa8f1267c 100644 > > --- a/docs/formatdomain.rst > > +++ b/docs/formatdomain.rst > > @@ -2736,6 +2736,15 @@ paravirtualized driver is specified via the ``disk`` element. > > <source dev='/dev/vhost-vdpa-0' /> > > <target dev='vdg' 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> > > ... > > > > @@ -3217,6 +3226,19 @@ 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 10.5.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 nodes in qemu shape a chain like libvirt-4-filter(node name of "limit012") -> > > + libvirt-3-filter(node name of "limit2") -> libvirt-2-format -> libvirt-1-storage. > > + ``throttlefilters`` and ``iotune`` should be used exclusively. > > Node names are a qemu driver internal implementation detail and thus > must not be noted in documentation. I'm not exactly sure how the internals in qemu work here, but you also might want to document how the order of the filters impacts things (or that it does not impact things).