util: fallback to ioctl(SIOCBRADDBR) if netlink RTM_NEWLINK fails
util: fallback to ioctl(SIOCBRADDBR) if netlink RTM_NEWLINK fails

commit fc7b23db switched from using ioctl(SIOCBRADDBR) for bridge
creation to using a netlink RTM_NEWLINK message with IFLA_INFO_KIND =
"bridge", which is the more modern way to create a bridge. However,
although older kernels (e.g. 2.6.32, in RHEL6/CentOS6) support
creating *some* link types with RTM_NEWLINK, they don't support
creating bridges, and there is no compile-time way to figure this out
(since the "type" isn't an enum, but rather a character string).

This patch moves the body of the SIOCBRADDBR version of
virNetDevBridgeCreate() into a static function, calls the new function
from the original, and also calls the new function from the
RTM_NEWLINK version if the RTM_NEWLINK message generates an EOPNOTSUPP
error.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1252780

jfehlig/libvirt,rlaager/libvirt,crobinso/libvirt,rlaager/libvirt,datto/libvirt,taget/libvirt,zippy2/libvirt,libvirt/libvirt,fabianfreyer/libvirt,jfehlig/libvirt,andreabolognani/libvirt,VenkatDatta/libvirt,datto/libvirt,zippy2/libvirt,eskultety/libvirt,nertpinx/libvirt,andreabolognani/libvirt,agx/libvirt,datto/libvirt,jfehlig/libvirt,jardasgit/libvirt,taget/libvirt,nertpinx/libvirt,rlaager/libvirt,VenkatDatta/libvirt,olafhering/libvirt,taget/libvirt,agx/libvirt,datto/libvirt,agx/libvirt,fabianfreyer/libvirt,jardasgit/libvirt,jardasgit/libvirt,fabianfreyer/libvirt,VenkatDatta/libvirt,libvirt/libvirt,rlaager/libvirt,VenkatDatta/libvirt,jardasgit/libvirt,taget/libvirt,eskultety/libvirt,taget/libvirt,olafhering/libvirt,nertpinx/libvirt,libvirt/libvirt,jfehlig/libvirt,agx/libvirt,olafhering/libvirt,rlaager/libvirt,nertpinx/libvirt,eskultety/libvirt,olafhering/libvirt,jardasgit/libvirt,fabianfreyer/libvirt,zippy2/libvirt,crobinso/libvirt,fabianfreyer/libvirt,VenkatDatta/libvirt,zippy2/libvirt,libvirt/libvirt,andreabolognani/libvirt,crobinso/libvirt,andreabolognani/libvirt,datto/libvirt,andreabolognani/libvirt,agx/libvirt,eskultety/libvirt,crobinso/libvirt,eskultety/libvirt,nertpinx/libvirt