aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Pettit <jpettit@nicira.com>2009-08-10 18:48:15 -0700
committerJustin Pettit <jpettit@nicira.com>2009-08-11 14:27:07 -0700
commitf35409904bc4a0a695a4aecb2435933d8a8187fe (patch)
tree999f0e184804ad7b4d2194e0776c9db3d8cf5ce2
parent5ec6690ca447dd25e3d04b60ca66d2e6e1cf37f2 (diff)
mgmt: Local config changes can cause update failures from controller.
If ovs-vswitchd.conf is locally modified, but ovs-vswitchd is not told to reload it, updates from the controller will be refused. This is because we attempt to lock the file with SHA-1 snapshot of the config file. Since the hashes will not match, we will never be able to lock the file, and all remote updates will fail. There is not much that can be done about this, since we don't want to presume the current state of the file is correct, since it could be in the process of being updated. With this commit, we attempt to detect this problem and log a message describing how to rectify it. Bug #1516
-rw-r--r--vswitchd/mgmt.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/vswitchd/mgmt.c b/vswitchd/mgmt.c
index e2cc4f1f..e6e7d4ef 100644
--- a/vswitchd/mgmt.c
+++ b/vswitchd/mgmt.c
@@ -640,6 +640,14 @@ recv_ofmp_config_update(uint32_t xid, const struct ofmp_header *ofmph,
/* xxx cfg_lock can fail for other reasons, such as being
* xxx locked... */
VLOG_WARN_RL(&rl, "config update failed due to bad cookie\n");
+
+ /* Check if our local view matches the controller, in which
+ * case, it is likely that there were local modifications
+ * without our being told to reread the config file. */
+ if (!memcmp(cfg_cookie, ofmpcu->cookie, sizeof cfg_cookie)) {
+ VLOG_WARN_RL(&rl, "config appears to have been locally modified "
+ "without having told ovs-vswitchd to reload");
+ }
send_config_update_ack(xid, false);
return 0;
}