The AutoAttach table is new in OVS 2.3.90, but ovs-vsctl was creating a
record in the table unconditionally whenever it created a new bridge.
This caused a gratuitous incompatibility with older databases, which can
be a problem during upgrade. This commit switches to creating the
AutoAttaach record for a bridge lazily, only when the first mapping is
created for the bridge.
VMware-BZ: #
1413562
CC: Dennis Flynn <drflynn@avaya.com>
Reported-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Justin Pettit <jpettit@nicira.com>
if (!parent_name) {
struct ovsrec_port *port;
if (!parent_name) {
struct ovsrec_port *port;
- struct ovsrec_autoattach *aa;
struct ovsrec_bridge *br;
iface = ovsrec_interface_insert(ctx->txn);
struct ovsrec_bridge *br;
iface = ovsrec_interface_insert(ctx->txn);
ovsrec_port_set_name(port, br_name);
ovsrec_port_set_interfaces(port, &iface, 1);
ovsrec_port_set_name(port, br_name);
ovsrec_port_set_interfaces(port, &iface, 1);
- aa = ovsrec_autoattach_insert(ctx->txn);
-
br = ovsrec_bridge_insert(ctx->txn);
ovsrec_bridge_set_name(br, br_name);
ovsrec_bridge_set_ports(br, &port, 1);
br = ovsrec_bridge_insert(ctx->txn);
ovsrec_bridge_set_name(br, br_name);
ovsrec_bridge_set_ports(br, &port, 1);
- ovsrec_bridge_set_auto_attach(br, aa);
ovs_insert_bridge(ctx->ovs, br);
} else {
ovs_insert_bridge(ctx->ovs, br);
} else {
}
if (br && br->br_cfg) {
}
if (br && br->br_cfg) {
+ if (!br->br_cfg->auto_attach) {
+ struct ovsrec_autoattach *aa = ovsrec_autoattach_insert(ctx->txn);
+ ovsrec_bridge_set_auto_attach(br->br_cfg, aa);
+ }
autoattach_insert_mapping(br->br_cfg->auto_attach, isid, vlan);
}
}
autoattach_insert_mapping(br->br_cfg->auto_attach, isid, vlan);
}
}