From: Ben Pfaff Date: Fri, 25 Mar 2011 22:15:33 +0000 (-0700) Subject: bridge: Convert svecs to ssets. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9759479ab6dd8a050f5838e01111536d8d6b2538;p=openvswitch bridge: Convert svecs to ssets. --- diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c index eb6f2ebe..001f9f68 100644 --- a/vswitchd/bridge.c +++ b/vswitchd/bridge.c @@ -374,7 +374,7 @@ static void bridge_configure_once(const struct ovsrec_open_vswitch *cfg) { static bool already_configured_once; - struct svec bridge_names; + struct sset bridge_names; struct sset dpif_names, dpif_types; const char *type; size_t i; @@ -388,11 +388,10 @@ bridge_configure_once(const struct ovsrec_open_vswitch *cfg) stats_timer = time_msec() + STATS_INTERVAL; /* Get all the configured bridges' names from 'cfg' into 'bridge_names'. */ - svec_init(&bridge_names); + sset_init(&bridge_names); for (i = 0; i < cfg->n_bridges; i++) { - svec_add(&bridge_names, cfg->bridges[i]->name); + sset_add(&bridge_names, cfg->bridges[i]->name); } - svec_sort(&bridge_names); /* Iterate over all system dpifs and delete any of them that do not appear * in 'cfg'. */ @@ -406,7 +405,7 @@ bridge_configure_once(const struct ovsrec_open_vswitch *cfg) /* Delete each dpif whose name is not in 'bridge_names'. */ SSET_FOR_EACH (name, &dpif_names) { - if (!svec_contains(&bridge_names, name)) { + if (!sset_contains(&bridge_names, name)) { struct dpif *dpif; int retval; @@ -418,7 +417,7 @@ bridge_configure_once(const struct ovsrec_open_vswitch *cfg) } } } - svec_destroy(&bridge_names); + sset_destroy(&bridge_names); sset_destroy(&dpif_names); sset_destroy(&dpif_types); }