- return db;
-}
-
-struct ovsdb_error *
-ovsdb_open(const char *file_name, bool read_only, struct ovsdb **dbp)
-{
- struct ovsdb_schema *schema;
- struct ovsdb_error *error;
- struct ovsdb_file *file;
- struct json *json;
- struct ovsdb *db;
-
- error = ovsdb_file_open(file_name, read_only ? O_RDONLY : O_RDWR, &file);
- if (error) {
- return error;
- }
-
- error = ovsdb_file_read(file, &json);
- if (error) {
- return error;
- } else if (!json) {
- return ovsdb_io_error(EOF, "%s: database file contains no schema",
- file_name);
- }
-
- error = ovsdb_schema_from_json(json, &schema);
- if (error) {
- json_destroy(json);
- return ovsdb_wrap_error(error,
- "failed to parse \"%s\" as ovsdb schema",
- file_name);
- }
- json_destroy(json);
+ /* Set all the refTables. */
+ SHASH_FOR_EACH (node, &schema->tables) {
+ struct ovsdb_table_schema *table = node->data;
+ struct shash_node *node2;