From: Ben Pfaff Date: Fri, 16 Jan 2009 18:11:04 +0000 (-0800) Subject: Revert "brcompat: Don't re-read configuration file from inside bridge code." X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2c08714a4fd97513caa784fb4b98aef39e2f7e9d;p=openvswitch Revert "brcompat: Don't re-read configuration file from inside bridge code." This reverts commit 2b34f542b1015b69c589bc4fa324d236cd35dd5f, because not re-reading the config file from phy_port_changed() meant that, later, the next time we modified the config file we would do it based on the older version, not the version that we just wrote out. --- diff --git a/vswitchd/brcompat.c b/vswitchd/brcompat.c index c6f18e77..39f0b4a7 100644 --- a/vswitchd/brcompat.c +++ b/vswitchd/brcompat.c @@ -58,7 +58,6 @@ #include "timeval.h" #include "util.h" #include "vlog-socket.h" -#include "vswitchd.h" #include "vlog.h" #define THIS_MODULE VLM_brcompat @@ -252,6 +251,8 @@ brc_modify_config(const char *dp_name, const char *port_name, brc_write_config(&new_cfg); svec_destroy(&new_cfg); + + cfg_read(); } static int @@ -262,7 +263,8 @@ brc_add_dp(const char *dp_name) } brc_modify_config(dp_name, NULL, BMC_ADD_DP); - reconfigure(); + + bridge_reconfigure(); if (!bridge_exists(dp_name)) { return EINVAL; @@ -279,7 +281,8 @@ brc_del_dp(const char *dp_name) } brc_modify_config(dp_name, NULL, BMC_DEL_DP); - reconfigure(); + + bridge_reconfigure(); if (bridge_exists(dp_name)) { return EINVAL; @@ -352,7 +355,9 @@ brc_handle_port_cmd(struct ofpbuf *buffer, bool add) } else { brc_modify_config(dp_name, port_name, BMC_DEL_PORT); } - reconfigure(); + + /* Force vswitchd to reconfigure itself. */ + bridge_reconfigure(); return 0; } diff --git a/vswitchd/vswitchd.c b/vswitchd/vswitchd.c index 85bf19c3..dc1cfa1d 100644 --- a/vswitchd/vswitchd.c +++ b/vswitchd/vswitchd.c @@ -26,8 +26,6 @@ #include -#include "vswitchd.h" - #include #include #include @@ -59,6 +57,8 @@ static void parse_options(int argc, char *argv[]); static void usage(void) NO_RETURN; +static void reconfigure(void); + static bool brc_enabled = false; int @@ -106,7 +106,7 @@ main(int argc, char *argv[]) return 0; } -void +static void reconfigure(void) { cfg_read(); diff --git a/vswitchd/vswitchd.h b/vswitchd/vswitchd.h deleted file mode 100644 index 53202863..00000000 --- a/vswitchd/vswitchd.h +++ /dev/null @@ -1,32 +0,0 @@ -/* Copyright (c) 2009 Nicira Networks - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - * In addition, as a special exception, Nicira Networks gives permission - * to link the code of its release of vswitchd with the OpenSSL project's - * "OpenSSL" library (or with modified versions of it that use the same - * license as the "OpenSSL" library), and distribute the linked - * executables. You must obey the GNU General Public License in all - * respects for all of the code used other than "OpenSSL". If you modify - * this file, you may extend this exception to your version of the file, - * but you are not obligated to do so. If you do not wish to do so, - * delete this exception statement from your version. - */ - -#ifndef VSWITCHD_H -#define VSWITCHD_H 1 - -void reconfigure(void); - -#endif /* vswitchd.h */