summaryrefslogtreecommitdiff
path: root/vswitchd
diff options
context:
space:
mode:
authorAndrew Evans <aevans@nicira.com>2011-06-30 15:15:46 -0700
committerAndrew Evans <aevans@nicira.com>2011-07-01 10:38:35 -0700
commit5d27908667cfa34f7786fdc88e9e09078453637a (patch)
tree58644b60f2faea78bc95d2dd539eeaf5a91ee7c6 /vswitchd
parent316dec68688aeccc1bbb90e555d9c0ca259d9fc7 (diff)
downloadopenvswitch-5d27908667cfa34f7786fdc88e9e09078453637a.tar.gz
bridge: Update controller connection status correctly.
Updates to status-related columns in the Controller table can be lost if there are multiple bridges with different sets of controllers. This commit fixes this behavior by first accumulating status for all controllers on all bridges, then making one pass over all rows in the Controller tables, updating the status of each. Bug #6185. Reported-by: Michael Hu <mhu@nicira.com>
Diffstat (limited to 'vswitchd')
-rw-r--r--vswitchd/bridge.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c
index 446f4fc0c..449957a9f 100644
--- a/vswitchd/bridge.c
+++ b/vswitchd/bridge.c
@@ -1348,13 +1348,20 @@ nx_role_to_str(enum nx_role role)
}
static void
-bridge_refresh_controller_status(const struct bridge *br)
+refresh_controller_status(void)
{
+ struct bridge *br;
struct shash info;
const struct ovsrec_controller *cfg;
- ofproto_get_ofproto_controller_info(br->ofproto, &info);
+ shash_init(&info);
+
+ /* Accumulate status for controllers on all bridges. */
+ HMAP_FOR_EACH (br, node, &all_bridges) {
+ ofproto_get_ofproto_controller_info(br->ofproto, &info);
+ }
+ /* Update each controller in the database with current status. */
OVSREC_CONTROLLER_FOR_EACH(cfg, idl) {
struct ofproto_controller_info *cinfo =
shash_find_data(&info, cfg->target);
@@ -1448,9 +1455,9 @@ bridge_run(void)
iface_refresh_status(iface);
}
}
- bridge_refresh_controller_status(br);
}
refresh_system_stats(cfg);
+ refresh_controller_status();
ovsdb_idl_txn_commit(txn);
ovsdb_idl_txn_destroy(txn); /* XXX */
}