render / rpms / libvirt

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