mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 05:35:25 +00:00
qemu: Validate QoS values in qemuDomainSetInterfaceParameters()
This is similar to one of my previous commits (v10.7.0-rc1~22) which introduced a check that <bandwidth/> values fit into certain limits. My original commit validated values when parsing <bandwidth/> XML, but completely missed the case when values are set over virDomainSetInterfaceParameters() API. Solution is simple - just perform validation after bandwidth structure is reconstructed from arguments passed to the API. Resolves: https://issues.redhat.com/browse/RHEL-65372 Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
This commit is contained in:
parent
9b55a130b7
commit
c4d6bd3bf5
@ -9883,6 +9883,9 @@ qemuDomainSetInterfaceParameters(virDomainPtr dom,
|
||||
if (!bandwidth->out->average)
|
||||
VIR_FREE(bandwidth->out);
|
||||
|
||||
if (!virNetDevBandwidthValidate(bandwidth))
|
||||
goto endjob;
|
||||
|
||||
if (net) {
|
||||
newBandwidth = g_new0(virNetDevBandwidth, 1);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user