[libvirt] [PATCH 1/3] network: consolidate connection count updates for device pool

John Ferlan jferlan at redhat.com
Fri Feb 12 21:38:21 UTC 2016

On 02/11/2016 04:37 PM, Laine Stump wrote:
> 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 | 19 +++++++++----------
>  1 file changed, 9 insertions(+), 10 deletions(-)



More information about the libvir-list mailing list