X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=ovsdb%2Fovsdb.c;h=b5f6edb12f2751fd8e3169f993cd4ffa5ba1b6f4;hb=ed951f15779df008e43012d99cdb51f3c5a57229;hp=2b5bdc32ec0c96dc97bcd6c855076904f8d1b0a8;hpb=c69ee87c10818267f991236201150b1fa51ae519;p=openvswitch diff --git a/ovsdb/ovsdb.c b/ovsdb/ovsdb.c index 2b5bdc32..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) {