+ return ovsdb_file_open__(file_name, NULL, read_only, dbp);
+}
+
+/* Opens database 'file_name' with an alternate schema. The specified 'schema'
+ * is used to interpret the data in 'file_name', ignoring the schema actually
+ * stored in the file. Data in the file for tables or columns that do not
+ * exist in 'schema' are ignored, but the ovsdb file format must otherwise be
+ * observed, including column constraints.
+ *
+ * This function can be useful for upgrading or downgrading databases to
+ * "almost-compatible" formats.
+ *
+ * The database will not be locked. Changes to the database will persist only
+ * as long as the "struct ovsdb".
+ *
+ * On success, stores a pointer to the new database in '*dbp' and returns a
+ * null pointer. On failure, returns an ovsdb_error (which the caller must
+ * destroy) and sets '*dbp' to NULL. */
+struct ovsdb_error *
+ovsdb_file_open_as_schema(const char *file_name,
+ const struct ovsdb_schema *schema,
+ struct ovsdb **dbp)
+{
+ return ovsdb_file_open__(file_name, schema, true, dbp);
+}
+
+static struct ovsdb_error *
+ovsdb_file_open__(const char *file_name,
+ const struct ovsdb_schema *alternate_schema,
+ bool read_only, struct ovsdb **dbp)
+{
+ enum ovsdb_log_open_mode open_mode;