From cc86ea5a03a320476a89e9a13f9539c0146fac43 Mon Sep 17 00:00:00 2001 From: Ben Pfaff <blp@nicira.com> Date: Wed, 9 Jun 2010 13:17:51 -0700 Subject: [PATCH] brcompatd: Remove commented-out code. This code was never converted from the configuration database to OVSDB. In the subsequent months the lack of it has not caused any problems, so this commit deletes it. --- vswitchd/ovs-brcompatd.c | 66 ---------------------------------------- 1 file changed, 66 deletions(-) diff --git a/vswitchd/ovs-brcompatd.c b/vswitchd/ovs-brcompatd.c index 29503015..a182b492 100644 --- a/vswitchd/ovs-brcompatd.c +++ b/vswitchd/ovs-brcompatd.c @@ -280,68 +280,6 @@ get_bridge_ports(const struct ovsrec_bridge *br, struct svec *ports, do_get_bridge_parts(br, ports, vlan, false); } -#if 0 -/* Go through the configuration file and remove any ports that no longer - * exist associated with a bridge. */ -static void -prune_ports(void) -{ - int i, j; - struct svec bridges, delete; - - if (cfg_lock(NULL, 0)) { - /* Couldn't lock config file. */ - return; - } - - svec_init(&bridges); - svec_init(&delete); - cfg_get_subsections(&bridges, "bridge"); - for (i=0; i<bridges.n; i++) { - const char *br_name = bridges.names[i]; - struct svec ifaces; - - /* Check that each bridge interface exists. */ - svec_init(&ifaces); - get_bridge_ifaces(br_name, &ifaces, -1); - for (j = 0; j < ifaces.n; j++) { - const char *iface_name = ifaces.names[j]; - - /* The local port and internal ports are created and destroyed by - * ovs-vswitchd itself, so don't bother checking for them at all. - * In practice, they might not exist if ovs-vswitchd hasn't - * finished reloading since the configuration file was updated. */ - if (!strcmp(iface_name, br_name) - || cfg_get_bool(0, "iface.%s.internal", iface_name)) { - continue; - } - - if (!netdev_exists(iface_name)) { - VLOG_INFO_RL(&rl, "removing dead interface %s from %s", - iface_name, br_name); - svec_add(&delete, iface_name); - } - } - svec_destroy(&ifaces); - } - svec_destroy(&bridges); - - if (delete.n) { - size_t i; - - for (i = 0; i < delete.n; i++) { - cfg_del_match("bridge.*.port=%s", delete.names[i]); - cfg_del_match("bonding.*.slave=%s", delete.names[i]); - } - reload_config(); - cfg_unlock(); - } else { - cfg_unlock(); - } - svec_destroy(&delete); -} -#endif - static struct ovsdb_idl_txn * txn_from_openvswitch(const struct ovsrec_open_vswitch *ovs) { @@ -1417,10 +1355,6 @@ main(int argc, char *argv[]) */ if (ovs && prune_timeout) { rtnl_recv_update(idl, ovs); -#if 0 - prune_ports(); -#endif - nl_sock_wait(rtnl_sock, POLLIN); poll_timer_wait(prune_timeout); } -- 2.30.2