]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commit
util: use netlink to create bridge devices
authorLaine Stump <laine@laine.org>
Mon, 23 Mar 2015 18:17:44 +0000 (14:17 -0400)
committerLaine Stump <laine@laine.org>
Thu, 26 Mar 2015 19:33:05 +0000 (15:33 -0400)
commitfc7b23db02062f5649022db1fd238c4bcc28476a
tree6ad561f5cf65925a5192fe85857d28abb3b1d17c
parent09778e0908822e9bf57a8b55e0150ad80e64e01f
util: use netlink to create bridge devices

Just as it is possible to delete a bridge device with the netlink
RTM_DELLINK message, one can be created with the RTM_NEWLINK
message. Because of differences in the format of the message, it's not
as straightforward as with virNetlinkDelLink() to create a single
utility function that can be used to create any type of interface, so
the new netlink version of virNetDevBridgeCreate() does its own
construction of the netlink message and calls virNetlinkCommand()
itself.

This doesn't provide any extra functionality, just provides symmetry
with the previous commit.

NB: We *could* alter the API of virNetDevBridgeCreate() to take a MAC
address, and directly program that mac address into the bridge (by
adding an IFLA_ADDRESS attribute, as is done in
virNetDevMacVLanCreate()) rather than separately creating the "dummy
tap" (e.g. virbr0-nic) to maintain a fixed mac address on the bridge,
but the commit history of virnetdevbridge.c shows that the presence of
this dummy tap is essential in some older versions of the kernel
(between 2.6.39 and 3.1 or 3.2, possibly?) to proper operation of IPv6
DAD, and I don't want to take the chance of breaking something that I
don't have the time/setup to test (my RHEL6 box is at kernel
2.6.32-544, and the next lowest kernel I have is 3.17)
src/util/virnetdevbridge.c