]> git.proxmox.com Git - mirror_ovs.git/blobdiff - ovsdb/ovsdb.c
ovsdb-server: drop all connections on read/write status change
[mirror_ovs.git] / ovsdb / ovsdb.c
index 3c51e1c19284bf52272df1a2d95237dcc81631f6..cfc96b32f8de90d7aefe05101922809c02b5110d 100644 (file)
@@ -118,16 +118,16 @@ ovsdb_schema_check_ref_table(struct ovsdb_column *column,
 {
     struct ovsdb_table_schema *refTable;
 
-    if (base->type != OVSDB_TYPE_UUID || !base->u.uuid.refTableName) {
+    if (base->type != OVSDB_TYPE_UUID || !base->uuid.refTableName) {
         return NULL;
     }
 
-    refTable = shash_find_data(tables, base->u.uuid.refTableName);
+    refTable = shash_find_data(tables, base->uuid.refTableName);
     if (!refTable) {
         return ovsdb_syntax_error(NULL, NULL,
                                   "column %s %s refers to undefined table %s",
                                   column->name, base_name,
-                                  base->u.uuid.refTableName);
+                                  base->uuid.refTableName);
     }
 
     if (ovsdb_base_type_is_strong_ref(base) && !refTable->is_root) {
@@ -388,11 +388,11 @@ static void
 ovsdb_set_ref_table(const struct shash *tables,
                     struct ovsdb_base_type *base)
 {
-    if (base->type == OVSDB_TYPE_UUID && base->u.uuid.refTableName) {
+    if (base->type == OVSDB_TYPE_UUID && base->uuid.refTableName) {
         struct ovsdb_table *table;
 
-        table = shash_find_data(tables, base->u.uuid.refTableName);
-        base->u.uuid.refTable = table;
+        table = shash_find_data(tables, base->uuid.refTableName);
+        base->uuid.refTable = table;
     }
 }
 
@@ -455,6 +455,9 @@ ovsdb_destroy(struct ovsdb *db)
         /* Remove all the monitors. */
         ovsdb_monitors_remove(db);
 
+        /* Destroy txn history. */
+        ovsdb_txn_history_destroy(db);
+
         /* The caller must ensure that no triggers remain. */
         ovs_assert(ovs_list_is_empty(&db->triggers));
 
@@ -535,6 +538,9 @@ ovsdb_replace(struct ovsdb *dst, struct ovsdb *src)
         ovsdb_trigger_prereplace_db(trigger);
     }
 
+    /* Destroy txn history. */
+    ovsdb_txn_history_destroy(dst);
+
     struct ovsdb_schema *tmp_schema = dst->schema;
     dst->schema = src->schema;
     src->schema = tmp_schema;