render / rpms / libvirt

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