aboutsummaryrefslogtreecommitdiff
path: root/vswitchd
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2013-04-11 15:47:08 -0700
committerBen Pfaff <blp@nicira.com>2013-04-11 15:54:30 -0700
commitfb9a39015716d47f8d922de9fc2478b25a5bf946 (patch)
treea6774221909722e89d9f9fe3be75051b3f70cbed /vswitchd
parent783cd86f3c37b1b63280332f237115a90d1c773a (diff)
bridge: Complete initial configuration even with empty database.
If the database was empty, that is, it did not even contain an Open_vSwitch top-level configuration record, at ovs-vswitchd startup time, then OVS failed to detach and used 100% CPU. This commit fixes the problem. This problem was introduced by commit 63ff04e82623e765 (bridge: Only complete daemonization after db commits initial config.). This problem did not manifest if the initscripts supplied with Open vSwitch were used, because those initscripts always initialize the database before starting ovs-vswitchd, so this problem affects only users with hand-rolled local OVS startup scripts. Bug #16090. Reported-by: Pravin Shelar <pshelar@nicira.com> Tested-by: Pravin Shelar <pshelar@nicira.com> Reported-by: Paul Ingram <paul@nicira.com> Reported-by: Amre Shakimov <ashakimov@vmware.com> Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Ansis Atteka <aatteka@nicira.com>
Diffstat (limited to 'vswitchd')
-rw-r--r--vswitchd/bridge.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c
index b83abad7..ef699df1 100644
--- a/vswitchd/bridge.c
+++ b/vswitchd/bridge.c
@@ -2284,25 +2284,25 @@ bridge_run(void)
}
if (reconfiguring) {
- if (cfg) {
- if (!reconf_txn) {
- reconf_txn = ovsdb_idl_txn_create(idl);
- }
- if (bridge_reconfigure_continue(cfg)) {
+ if (!reconf_txn) {
+ reconf_txn = ovsdb_idl_txn_create(idl);
+ }
+
+ if (bridge_reconfigure_continue(cfg ? cfg : &null_cfg)) {
+ reconfiguring = false;
+
+ if (cfg) {
ovsrec_open_vswitch_set_cur_cfg(cfg, cfg->next_cfg);
- reconfiguring = false;
-
- /* If we are completing our initial configuration for this run
- * of ovs-vswitchd, then keep the transaction around to monitor
- * it for completion. */
- if (!initial_config_done) {
- initial_config_done = true;
- daemonize_txn = reconf_txn;
- reconf_txn = NULL;
- }
}
- } else {
- bridge_reconfigure_continue(&null_cfg);
+
+ /* If we are completing our initial configuration for this run
+ * of ovs-vswitchd, then keep the transaction around to monitor
+ * it for completion. */
+ if (!initial_config_done) {
+ initial_config_done = true;
+ daemonize_txn = reconf_txn;
+ reconf_txn = NULL;
+ }
}
}