0700a3d network: don't even call networkRunHook if there is no network

Authored and Committed by Laine Stump 10 years ago
    network: don't even call networkRunHook if there is no network
    
    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.
    
        
file modified
+23 -24