X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=ovsdb%2Fovsdb.c;h=b5f6edb12f2751fd8e3169f993cd4ffa5ba1b6f4;hb=90887925206f585db65ae8872f197a97543f2860;hp=2dea507cbf1cd2426800e87b0dd7a74782b06fbb;hpb=0d0f05b909b6428d44eb147bd4edd73782d2a137;p=openvswitch diff --git a/ovsdb/ovsdb.c b/ovsdb/ovsdb.c index 2dea507c..b5f6edb1 100644 --- a/ovsdb/ovsdb.c +++ b/ovsdb/ovsdb.c @@ -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);