]> git.ipfire.org Git - thirdparty/libvirt.git/commit
util: new function virNetDevIPInfoAddToDev
authorLaine Stump <laine@laine.org>
Thu, 16 Jun 2016 16:22:07 +0000 (12:22 -0400)
committerLaine Stump <laine@laine.org>
Sun, 26 Jun 2016 23:33:10 +0000 (19:33 -0400)
commitf1e0d0da11c473905470c28a6488bf57d9d0ae6e
treecc96ff41878126bfbaa414162a676013976a6bd1
parent4ff9ec7dae74ff6cc0f5ce1ae46a90f3a057be94
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).
src/libvirt_private.syms
src/lxc/lxc_container.c
src/util/virnetdevip.c
src/util/virnetdevip.h