[PATCH] networkStartNetworkVirtual: Don't overwrite error in 'err5'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If there's an error when setting up QoS on a bridge the control
jumps over to 'err5' label. Here, the virNetDevBandwidthClear()
is called to clear out any partially set QoS. This function can
also report an error which would overwrite the actual error that
caused us jumping here. 🤦 Use virErrorPreserveLast() to preserve
the original error.

Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
---
 src/network/bridge_driver.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c
index ce4f4890f1..77206b4584 100644
--- a/src/network/bridge_driver.c
+++ b/src/network/bridge_driver.c
@@ -2493,6 +2493,7 @@ networkStartNetworkVirtual(virNetworkDriverStatePtr driver,
     return 0;
 
  err5:
+    virErrorPreserveLast(&save_err);
     if (def->bandwidth)
        virNetDevBandwidthClear(def->bridge);
 
-- 
2.21.0

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux