f1e0d0d util: new function virNetDevIPInfoAddToDev

Authored and Committed by Laine Stump 7 years ago
    util: new function virNetDevIPInfoAddToDev
    
    This patch takes the code out of
    lxcContainerRenameAndEnableInterfaces() that adds all IP addresses and
    IP routes to the interface, and puts it into a utility function
    virNetDevIPInfoAddToDev() in virnetdevip.c so that it can be used by
    anyone.
    
    One small change in functionality -
    lxcContainerRenameAndEnableInterfaces() previously would add all IP
    addresses to the interface while it was still offline, then set the
    interface online, and then add the routes. Because I don't want the
    utility function to set the interface online, I've moved this up so
    the interface is first set online, then IP addresses and routes are
    added. This is the same order that the network service from
    initscripts (in ifup-ether) does it, so it shouldn't pose any problem
    (and hasn't, in the tests that I've run).
    
        
file modified
+1 -0
file modified
+11 -36
file modified
+60 -0
file modified
+2 -0