From f35409904bc4a0a695a4aecb2435933d8a8187fe Mon Sep 17 00:00:00 2001 From: Justin Pettit Date: Mon, 10 Aug 2009 18:48:15 -0700 Subject: [PATCH] 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 --- vswitchd/mgmt.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/vswitchd/mgmt.c b/vswitchd/mgmt.c index e2cc4f1f8..e6e7d4ef6 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; } -- 2.39.5