From: Laine Stump Date: Fri, 11 Mar 2016 15:59:19 +0000 (-0500) Subject: network: differentiate macvtap/bridge from host-bridge based networks X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=2a537fe187fbca9d95816ffdd9db0327f70ae1be;p=libvirt.git network: differentiate macvtap/bridge from host-bridge based networks Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1316465 An attempt to simplify the code for the VIR_NETWORK_FORWARD_BRIDGE case of networkUpdateState in commit b61db335 (first in release 1.2.14) resulted in networks based on macvtap bridge mode being erroneously marked as inactive any time libvirtd was restarted. The problem is that the original code had differentiated between a network using tap devices to connect to an existing host-bridge device (forward mode of VIR_NETWORK_FORWARD_BRIDGE and a non-NULL def->bridge), and one using macvtap bridge mode to connect to any ethernet device (still forward mode VIR_NETWORK_FORWARD_BRIDGE, but null def->bridge), but the changed code assumed that all networks with VIR_NETWORK_FORWARD_BRIDGE were tap + host-bridge networks, so a null def->bridge was interpreted as "inactive". This patch restores the original code in networkUpdateState --- diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c index a09a7e474f..c2dbda6c0b 100644 --- a/src/network/bridge_driver.c +++ b/src/network/bridge_driver.c @@ -405,7 +405,8 @@ networkUpdateState(virNetworkObjPtr obj, break; case VIR_NETWORK_FORWARD_BRIDGE: - if (!(obj->def->bridge && virNetDevExists(obj->def->bridge) == 1)) { + if (obj->def->bridge) { + if (virNetDevExists(obj->def->bridge) != 1) obj->active = 0; break; }