]> git.ipfire.org Git - thirdparty/libvirt.git/commit
network: consolidate connection count updates for device pool
authorLaine Stump <laine@laine.org>
Thu, 11 Feb 2016 18:52:04 +0000 (13:52 -0500)
committerLaine Stump <laine@laine.org>
Sun, 14 Feb 2016 16:27:27 +0000 (11:27 -0500)
commit3ea8b8b87f5c9efdf12b2a162cac072081355f63
tree5a3fad58a855cd5ac42a118cc4b2179ea790a282
parent98782f88991a390a358cea960b5776f72fc14451
network: consolidate connection count updates for device pool

networkReleaseActualDevice() and networkNotifyActualDevice() both were
updating the individual devices' connections count in two separate
places (unlike networkAllocateActualDevice() which does it in a single
unified place after success:). The code is correct, but prone to
confusion / later breakage. All of these updates are anyway located at
the end of if/else clauses that are (with the exception of a single
VIR_DEBUG() in each case) immediately followed by the success: label
anyway, so this patch replaces the duplicated ++/-- instructions with
a single ++/-- inside a qualifying "if (dev)" down below success:.
(NB: if dev != NULL, by definition we are using a device (either pci
or netdev, doesn't matter for these purposes) from the network's pool)

The VIR_DEBUG args (which will be replaced in a followup patch anyway)
were all adjusted to account for the connection count being out of
date at the time.
src/network/bridge_driver.c