]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: do not revert to NULL bandwidth
authorJán Tomko <jtomko@redhat.com>
Fri, 7 Feb 2020 11:40:39 +0000 (12:40 +0100)
committerJán Tomko <jtomko@redhat.com>
Mon, 10 Feb 2020 15:41:51 +0000 (16:41 +0100)
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: f02e21cb3379a41cd42f2d8116f2d10dabace83b
https://bugzilla.redhat.com/show_bug.cgi?id=1800505
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
src/qemu/qemu_driver.c

index e69d083836f7f15b3847eee0fa86522cc7169f8f..9b244ec4f2d3549510a978d2d392be5619086af4 100644 (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;
         }