ofproto: Querying port stats for individual ports (OpenFlow 1.0)
[openvswitch] / ovsdb / ovsdb.c
index 2dea507cbf1cd2426800e87b0dd7a74782b06fbb..b5f6edb12f2751fd8e3169f993cd4ffa5ba1b6f4 100644 (file)
@@ -38,6 +38,22 @@ ovsdb_schema_create(const char *name, const char *comment)
     return schema;
 }
 
+struct ovsdb_schema *
+ovsdb_schema_clone(const struct ovsdb_schema *old)
+{
+    struct ovsdb_schema *new;
+    struct shash_node *node;
+
+    new = ovsdb_schema_create(old->name, old->comment);
+    SHASH_FOR_EACH (node, &old->tables) {
+        const struct ovsdb_table_schema *ts = node->data;
+
+        shash_add(&new->tables, node->name, ovsdb_table_schema_clone(ts));
+    }
+    return new;
+}
+
+
 void
 ovsdb_schema_destroy(struct ovsdb_schema *schema)
 {
@@ -287,7 +303,7 @@ ovsdb_add_replica(struct ovsdb *db, struct ovsdb_replica *r)
 }
 
 void
-ovsdb_remove_replica(struct ovsdb *db UNUSED, struct ovsdb_replica *r)
+ovsdb_remove_replica(struct ovsdb *db OVS_UNUSED, struct ovsdb_replica *r)
 {
     list_remove(&r->node);
     (r->class->destroy)(r);