struct ovsrec_port *port;
struct ovsrec_interface *iface;
struct ovsdb_idl_txn *txn;
+ char *comment;
if (find_bridge(ovs, br_name)) {
VLOG_WARN("addbr %s: bridge %s exists", br_name, br_name);
txn = ovsdb_idl_txn_create(idl);
+ comment = xasprintf("ovs-brcompatd: addbr %s", br_name);
+ ovsdb_idl_txn_add_comment(txn, comment);
+ free(comment);
+
iface = ovsrec_interface_insert(txn_from_openvswitch(ovs));
ovsrec_interface_set_name(iface, br_name);
struct ovsrec_bridge *br = find_bridge(ovs, br_name);
struct ovsrec_bridge **bridges;
struct ovsdb_idl_txn *txn;
+ char *comment;
size_t i, n;
if (!br) {
txn = ovsdb_idl_txn_create(idl);
+ comment = xasprintf("ovs-brcompatd: delbr %s", br_name);
+ ovsdb_idl_txn_add_comment(txn, comment);
+ free(comment);
+
del_port(br, br_name);
bridges = xmalloc(sizeof *ovs->bridges * ovs->n_bridges);
} else {
do {
struct ovsdb_idl_txn *txn = ovsdb_idl_txn_create(idl);
+ char *comment;
+
if (add) {
+ comment = xasprintf("ovs-brcompatd: add-if %s", port_name);
add_port(ovs, br, port_name);
} else {
+ comment = xasprintf("ovs-brcompatd: del-if %s", port_name);
del_port(br, port_name);
}
+
+ ovsdb_idl_txn_add_comment(txn, comment);
+ free(comment);
+
error = commit_txn(txn, true);
VLOG_INFO_RL(&rl, "%s %s %s: %s",
cmd_name, br_name, port_name, strerror(error));
/* Network device is really gone. */
struct ovsdb_idl_txn *txn;
struct ovsrec_bridge *br;
+ char *comment;
VLOG_INFO("network device %s destroyed, "
"removing from bridge %s", port_name, br_name);
}
txn = ovsdb_idl_txn_create(idl);
+
+ comment = xasprintf("ovs-brcompatd: destroy port %s",
+ port_name);
+ ovsdb_idl_txn_add_comment(txn, comment);
+ free(comment);
+
del_port(br, port_name);
commit_txn(txn, false);
} else {