return 0;
}
-enum bmc_action {
- BMC_ADD_DP,
- BMC_DEL_DP,
- BMC_ADD_PORT,
- BMC_DEL_PORT
-};
-
/* Modify the existing configuration according to 'act'. The configuration
* file will be modified to reflect these changes. The caller is
* responsible for causing vswitchd to actually re-read its configuration. */
-static void
+void
brc_modify_config(const char *dp_name, const char *port_name,
enum bmc_action act)
{
brc_write_config(&new_cfg);
svec_destroy(&new_cfg);
+
+ cfg_read();
}
static int
brc_modify_config(dp_name, NULL, BMC_ADD_DP);
- cfg_read();
bridge_reconfigure();
if (!bridge_exists(dp_name)) {
brc_modify_config(dp_name, NULL, BMC_DEL_DP);
- cfg_read();
bridge_reconfigure();
if (bridge_exists(dp_name)) {
}
/* Force vswitchd to reconfigure itself. */
- cfg_read();
bridge_reconfigure();
return 0;
#ifndef VSWITCHD_BRCOMPAT_H
#define VSWITCHD_BRCOMPAT_H 1
+
+/* Actions to modify bridge compatibility configuration. */
+enum bmc_action {
+ BMC_ADD_DP,
+ BMC_DEL_DP,
+ BMC_ADD_PORT,
+ BMC_DEL_PORT
+};
+
void brc_init(const char *);
void brc_wait(void);
void brc_run(void);
+void brc_modify_config(const char *dp_name, const char *port_name,
+ enum bmc_action act);
#endif /* brcompat.h */
#include <sys/socket.h>
#include <unistd.h>
#include "bitmap.h"
+#include "brcompat.h"
#include "cfg.h"
#include "dirs.h"
#include "dpif.h"
br->name, port->name);
port_destroy(port);
}
+
+ brc_modify_config(br->name, (const char *)opp->name, BMC_DEL_PORT);
bridge_flush(br);
} else {
if (port->n_ifaces > 1) {