brcompatd: Remove commented-out code.
authorBen Pfaff <blp@nicira.com>
Wed, 9 Jun 2010 20:17:51 +0000 (13:17 -0700)
committerBen Pfaff <blp@nicira.com>
Tue, 15 Jun 2010 17:45:13 +0000 (10:45 -0700)
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

index 29503015b774e1324a625979e490bc3ae47329f5..a182b492cd126b51f2455f862d89032dafbb7ae9 100644 (file)
@@ -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);
         }