Laine Stump b64d62c6b8 util: fallback to ioctl(SIOCBRDELBR) if netlink RTM_DELLINK fails
commit 09778e09 switched from using ioctl(SIOCBRDELBR) for bridge
device deletion to using a netlink RTM_DELLINK message, which is the
more modern way to delete a bridge (and also doesn't require the
bridge to be ~IFF_UP to succeed). However, although older kernels
(e.g. 2.6.32, in RHEL6/CentOS6) support deleting *some* link types
with RTM_NEWLINK, they don't support deleting bridges, and there is no
compile-time way to figure this out.

This patch moves the body of the SIOCBRDELBR version of
virNetDevBridgeDelete() into a static function, calls the new function
from the original, and also calls the new function from the
RTM_DELLINK version if the RTM_DELLINK message generates an EOPNOTSUPP
error. Since RTM_DELLINK is done from the subordinate function
virNetlinkDelLink, which is also called for other purposes (deleting a
macvtap interface), a function pointer called "fallback" has been
added to the arglist of virNetlinkDelLink() - if that arg != NULL, the
provided function will be called when (and only when) RTM_DELLINK
fails with EOPNOTSUPP.

Resolves:  https://bugzilla.redhat.com/show_bug.cgi?id=1252780 (part 2)
(cherry picked from commit 97d26e470d5be2f1178cedfea212c5983afd7b30)
2015-09-21 20:18:03 -04:00
..
2014-07-16 06:48:53 -06:00
2015-04-16 18:35:41 +02:00
2014-12-15 10:34:18 +01:00
2015-07-10 11:47:13 +02:00
2015-09-02 18:57:15 -04:00
2015-09-02 18:57:15 -04:00
2015-07-10 11:47:13 +02:00
2015-07-10 11:47:13 +02:00
2014-10-22 13:09:49 +01:00
2015-06-25 09:11:15 +02:00
2013-12-24 17:36:47 +01:00
2013-12-24 17:36:47 +01:00
2015-04-02 16:05:32 +02:00
2015-04-15 16:43:28 +02:00
2014-12-16 11:15:27 +01:00
2015-07-01 12:15:16 -04:00
2015-03-13 15:31:33 +01:00
2015-09-21 20:18:00 -04:00
2015-03-25 10:00:53 +01:00
2014-10-15 09:25:33 +02:00
2014-07-03 10:41:15 +02:00
2014-03-04 12:24:13 +00:00