libvirt/SOURCES/libvirt-qemu-do-not-revert-to-NULL-bandwidth.patch

46 lines
1.8 KiB
Diff
Raw Normal View History

From ce01c67e13d27e578d13192bb20b585f1707f672 Mon Sep 17 00:00:00 2001
Message-Id: <ce01c67e13d27e578d13192bb20b585f1707f672@dist-git>
From: =?UTF-8?q?J=C3=A1n=20Tomko?= <jtomko@redhat.com>
Date: Mon, 10 Feb 2020 17:05:53 +0100
Subject: [PATCH] qemu: do not revert to NULL bandwidth
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
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>
(cherry picked from commit bd622e2a211aad449b54683e2ebd5e980418dd7c)
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Message-Id: <6096c4347521d1493728cc7842f6ad455665b744.1581350626.git.jtomko@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
---
src/qemu/qemu_driver.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index caeb76a20c..08f492fa24 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -11646,8 +11646,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;
}
--
2.25.0