qemu: do not revert to NULL bandwidth

Otherwise an attempt to set an invalid value:
  virsh domiftune rhel8.2 vnet0 --outbound 4294968
on an interface with no bandwidth set crashes.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Fixes: f02e21cb33
https://bugzilla.redhat.com/show_bug.cgi?id=1800505
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
This commit is contained in:
Ján Tomko 2020-02-07 12:40:39 +01:00
parent cebb468ef5
commit bd622e2a21

View File

@ -11682,8 +11682,10 @@ qemuDomainSetInterfaceParameters(virDomainPtr dom,
net->bandwidth,
false,
!virDomainNetTypeSharesHostView(net)));
ignore_value(virDomainNetBandwidthUpdate(net,
net->bandwidth));
if (net->bandwidth) {
ignore_value(virDomainNetBandwidthUpdate(net,
net->bandwidth));
}
goto endjob;
}