提交 b41261f0 编写于 作者: L Laine Stump

network: call proper start/stop functions for macvtap bridge-mode networks

networkStartNetwork() and networkShutdownNetwork() were calling the
wrong type-specific function in the case of networks that were
configured for macvtap ("direct") bridge mode - they were instead
calling the functions for a tap+bridge network. Currently none of
these functions does anything (they just return 0) so it hasn't
created any problems, but that could change in the future.
上级 2a537fe1
......@@ -2490,10 +2490,15 @@ networkStartNetwork(virNetworkDriverStatePtr driver,
break;
case VIR_NETWORK_FORWARD_BRIDGE:
if (networkStartNetworkBridge(network) < 0)
goto cleanup;
break;
if (network->def->bridge) {
if (networkStartNetworkBridge(network) < 0)
goto cleanup;
break;
}
/* intentionally fall through to the macvtap/direct case for
* VIR_NETWORK_FORWARD_BRIDGE with no bridge device defined
* (since that is macvtap bridge mode).
*/
case VIR_NETWORK_FORWARD_PRIVATE:
case VIR_NETWORK_FORWARD_VEPA:
case VIR_NETWORK_FORWARD_PASSTHROUGH:
......@@ -2562,9 +2567,14 @@ networkShutdownNetwork(virNetworkDriverStatePtr driver,
break;
case VIR_NETWORK_FORWARD_BRIDGE:
ret = networkShutdownNetworkBridge(network);
break;
if (network->def->bridge) {
ret = networkShutdownNetworkBridge(network);
break;
}
/* intentionally fall through to the macvtap/direct case for
* VIR_NETWORK_FORWARD_BRIDGE with no bridge device defined
* (since that is macvtap bridge mode).
*/
case VIR_NETWORK_FORWARD_PRIVATE:
case VIR_NETWORK_FORWARD_VEPA:
case VIR_NETWORK_FORWARD_PASSTHROUGH:
......@@ -4691,8 +4701,8 @@ networkGetNetworkAddress(const char *netname, char **netaddr)
if ((dev_name = netdef->bridge))
break;
/*
* fall through if netdef->bridge wasn't set, since this is
* also a direct-mode interface.
* fall through if netdef->bridge wasn't set, since that is
* macvtap bridge mode network.
*/
case VIR_NETWORK_FORWARD_PRIVATE:
case VIR_NETWORK_FORWARD_VEPA:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册