[libvirt] [PATCH 1/2] util: fallback to ioctl(SIOCBRADDBR) if netlink RTM_NEWLINK fails

Michal Privoznik mprivozn at redhat.com
Fri Aug 28 01:12:46 UTC 2015


On 26.08.2015 05:47, Laine Stump wrote:
> commit fc7b23db switched from using ioctl(SIOCBRADDBR) to using a
> netlink RTM_NEWLINK message with an IFLA_INFO_KIND of "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.
> 
> This resolves:
> 
>   https://bugzilla.redhat.com/show_bug.cgi?id=1252780
> ---
>  src/util/virnetdevbridge.c | 64 ++++++++++++++++++++++++++++++++--------------
>  1 file changed, 45 insertions(+), 19 deletions(-)

ACK

Michal




More information about the libvir-list mailing list