[libvirt] [PATCH] network: don't even call networkRunHook if there is no network

Eric Blake eblake at redhat.com
Tue Feb 25 23:41:39 UTC 2014


On 02/25/2014 08:46 AM, Laine Stump wrote:
> networkAllocateActualDevice() is called for *all* interfaces, not just
> those with type='network'. In that case, it will jump down to its
> validate: label immediately, without allocating anything. After
> validation is done, two counters are potentially updated (one for the
> network, and one for any particular physical device that is chosen),
> and then networkRunHook() is called.
> 
> This patch refactors that code a slight bit so that networkRunHook()
> doesn't get called if netdef is NULL (i.e. type != network) and to
> place the conditional increment of dev->connections inside the "if
> (netdef)" as well - dev can never be non-null if netdef is null
> (because "dev" is the pointer to a device in a network's pool of
> devices), so this doesn't have any functional effect, it just makes
> the code clearer.
> ---
>  src/network/bridge_driver.c | 47 ++++++++++++++++++++++-----------------------
>  1 file changed, 23 insertions(+), 24 deletions(-)

ACK.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 604 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20140225/cbd11873/attachment-0001.sig>


More information about the libvir-list mailing list