[ovs-discuss] [PATCH] mgmt: Local config changes can cause update failures from controller.

Justin Pettit jpettit at nicira.com
Tue Aug 11 02:07:41 UTC 2009


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
---
 vswitchd/mgmt.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/vswitchd/mgmt.c b/vswitchd/mgmt.c
index e2cc4f1..e6e7d4e 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;
     }
-- 
1.5.5





More information about the discuss mailing list