fbe740
From ce01c67e13d27e578d13192bb20b585f1707f672 Mon Sep 17 00:00:00 2001
fbe740
Message-Id: <ce01c67e13d27e578d13192bb20b585f1707f672@dist-git>
fbe740
From: =?UTF-8?q?J=C3=A1n=20Tomko?= <jtomko@redhat.com>
fbe740
Date: Mon, 10 Feb 2020 17:05:53 +0100
fbe740
Subject: [PATCH] qemu: do not revert to NULL bandwidth
fbe740
MIME-Version: 1.0
fbe740
Content-Type: text/plain; charset=UTF-8
fbe740
Content-Transfer-Encoding: 8bit
fbe740
fbe740
Otherwise an attempt to set an invalid value:
fbe740
  virsh domiftune rhel8.2 vnet0 --outbound 4294968
fbe740
on an interface with no bandwidth set crashes.
fbe740
fbe740
Signed-off-by: Ján Tomko <jtomko@redhat.com>
fbe740
Fixes: f02e21cb3379a41cd42f2d8116f2d10dabace83b
fbe740
https://bugzilla.redhat.com/show_bug.cgi?id=1800505
fbe740
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
fbe740
(cherry picked from commit bd622e2a211aad449b54683e2ebd5e980418dd7c)
fbe740
Signed-off-by: Ján Tomko <jtomko@redhat.com>
fbe740
Message-Id: <6096c4347521d1493728cc7842f6ad455665b744.1581350626.git.jtomko@redhat.com>
fbe740
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
fbe740
---
fbe740
 src/qemu/qemu_driver.c | 6 ++++--
fbe740
 1 file changed, 4 insertions(+), 2 deletions(-)
fbe740
fbe740
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
fbe740
index caeb76a20c..08f492fa24 100644
fbe740
--- a/src/qemu/qemu_driver.c
fbe740
+++ b/src/qemu/qemu_driver.c
fbe740
@@ -11646,8 +11646,10 @@ qemuDomainSetInterfaceParameters(virDomainPtr dom,
fbe740
                                                net->bandwidth,
fbe740
                                                false,
fbe740
                                                !virDomainNetTypeSharesHostView(net)));
fbe740
-            ignore_value(virDomainNetBandwidthUpdate(net,
fbe740
-                                                     net->bandwidth));
fbe740
+            if (net->bandwidth) {
fbe740
+                ignore_value(virDomainNetBandwidthUpdate(net,
fbe740
+                                                         net->bandwidth));
fbe740
+            }
fbe740
             goto endjob;
fbe740
         }
fbe740
 
fbe740
-- 
fbe740
2.25.0
fbe740