vswitch: Remove unnecessary iface_get_options function
authorJustin Pettit <jpettit@nicira.com>
Thu, 2 Dec 2010 02:03:44 +0000 (18:03 -0800)
committerJustin Pettit <jpettit@nicira.com>
Tue, 28 Dec 2010 22:30:36 +0000 (14:30 -0800)
Since GRE-over-IPsec is a proper tunnel type and no longer configured
through "other_config", we can remove this function that folded an
interface's "other_confg" into "options".

vswitchd/bridge.c

index f739505e3ec06c3b2be31e560511805754f10f53..96a24fd963e11b6310a6cda9807975541d8f5e70 100644 (file)
@@ -395,30 +395,6 @@ bridge_configure_once(const struct ovsrec_open_vswitch *cfg)
     svec_destroy(&dpif_types);
 }
 
-/* Initializes 'options' and fills it with the options for 'if_cfg'. Merges
- * keys from "options" and "other_config", preferring "options" keys over
- * "other_config" keys. */
-static void
-iface_get_options(const struct ovsrec_interface *if_cfg, struct shash *options)
-{
-    size_t i;
-
-    shash_from_ovs_idl_map(if_cfg->key_options, if_cfg->value_options,
-                           if_cfg->n_options, options);
-
-    for (i = 0; i < if_cfg->n_other_config; i++) {
-        char *key = if_cfg->key_other_config[i];
-        char *value = if_cfg->value_other_config[i];
-
-        if (!shash_find_data(options, key)) {
-            shash_add(options, key, value);
-        } else {
-            VLOG_WARN("%s: ignoring \"other_config\" key %s that conflicts "
-                      "with \"options\" key %s", if_cfg->name, key, key);
-        }
-    }
-}
-
 /* Callback for iterate_and_prune_ifaces(). */
 static bool
 check_iface(struct bridge *br, struct iface *iface, void *aux OVS_UNUSED)
@@ -695,7 +671,9 @@ bridge_reconfigure(const struct ovsrec_open_vswitch *ovs_cfg)
 
                 shash_init(&args);
                 if (iface) {
-                    iface_get_options(iface->cfg, &args);
+                    shash_from_ovs_idl_map(iface->cfg->key_options, 
+                                           iface->cfg->value_options,
+                                           iface->cfg->n_options, &args);
                 }
                 error = netdev_open(&options, &netdev);
                 shash_destroy(&args);
@@ -733,7 +711,9 @@ bridge_reconfigure(const struct ovsrec_open_vswitch *ovs_cfg)
                 struct shash args;
 
                 shash_init(&args);
-                iface_get_options(iface->cfg, &args);
+                shash_from_ovs_idl_map(iface->cfg->key_options, 
+                                       iface->cfg->value_options,
+                                       iface->cfg->n_options, &args);
                 netdev_reconfigure(iface->netdev, &args);
                 shash_destroy(&args);
             }