]> git.ipfire.org Git - thirdparty/libvirt.git/commit
network: unplug bandwidth and call networkRunHook only when appropriate
authorLaine Stump <laine@laine.org>
Tue, 25 Feb 2014 14:47:22 +0000 (16:47 +0200)
committerLaine Stump <laine@laine.org>
Wed, 26 Feb 2014 11:08:56 +0000 (13:08 +0200)
commiteed46d4cfe449e6a36a473c6386c11e9ae6d8525
treebe71e2b1e3a026e788a9f3f47c5e1acdd56ab934
parent0700a3dac4d20a7984f46d4f1862890a922512fd
network: unplug bandwidth and call networkRunHook only when appropriate

According to commit b4e0299d if networkAllocateActualDevice() was
successful, it will *always* allocate an iface->data.network.actual,
so we can use this during networkReleaseActualDevice() to know if
there is really anything to undo. We were properly using this
information to only decrement the network connections counter if it
had previously been incremented, but we were unconditionally
unplugging bandwidth and calling the "unplugged" network hook for
*all* interfaces (during qemuProcessStop()) whether they had been
previously plugged or not. This caused problems if a domain failed to
start at some time prior to all interfaces being allocated. (I
encountered this when an interface had a bandwidth floor set but no
inbound QoS).

This patch changes both the call to networkUnplugBandwidth() and the
call to networkRunHook() to only be called if there was a previous
call to "plug" for the same interface.
src/network/bridge_driver.c