]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
networkStartNetworkVirtual: Don't overwrite error in 'err5'
authorMichal Privoznik <mprivozn@redhat.com>
Tue, 23 Apr 2019 14:04:55 +0000 (16:04 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Wed, 24 Apr 2019 07:33:45 +0000 (09:33 +0200)
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@redhat.com>
src/network/bridge_driver.c

index ce4f4890f1e07a47d4ca4bc5ec4abac196b750e2..77206b45844e92f5326c8070cdb338b6bd3208a8 100644 (file)
@@ -2493,6 +2493,7 @@ networkStartNetworkVirtual(virNetworkDriverStatePtr driver,
     return 0;
 
  err5:
+    virErrorPreserveLast(&save_err);
     if (def->bandwidth)
        virNetDevBandwidthClear(def->bridge);