]> git.ipfire.org Git - thirdparty/libvirt.git/commit
conf: Introduce virNetDevBandwidthValidate()
authorMichal Privoznik <mprivozn@redhat.com>
Tue, 13 Aug 2024 11:15:50 +0000 (13:15 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 20 Aug 2024 07:19:25 +0000 (09:19 +0200)
commitab489ea3181052959bb3c6e72c31cec6915bd7a5
tree7b80d3fbcd4f46d7c50ff928fa61a91e84ba0437
parentf644cba8ae9ea186c676736a495c16deb1485839
conf: Introduce virNetDevBandwidthValidate()

This function validates whether parsed limits are within range as
defined by 'tc' sources (since we use tc to set QoS; or OVS which
then uses tc too). The 'tc' program stores speeds in 64bit
integers (unit is bytes per second) and sizes in uints (unit is
bytes). We use different units: kilobytes per second and
kibibytes and therefore we can parse values larger than 'tc' can
handle and thus need a function to check if values still fit.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
src/conf/netdev_bandwidth_conf.c
src/conf/netdev_bandwidth_conf.h
src/libvirt_private.syms