-static const char *
-get_db_name(const struct ovsdb_jsonrpc_session *s)
-{
- return s->remote->server->up.db->schema->name;
-}
-
-static struct jsonrpc_msg *
-ovsdb_jsonrpc_check_db_name(const struct ovsdb_jsonrpc_session *s,
- const struct jsonrpc_msg *request)
+/* Examines 'request' to determine the database to which it relates, and then
+ * searches 's' to find that database:
+ *
+ * - If successful, returns the database and sets '*replyp' to NULL.
+ *
+ * - If no such database exists, returns NULL and sets '*replyp' to an
+ * appropriate JSON-RPC error reply, owned by the caller. */
+static struct ovsdb *
+ovsdb_jsonrpc_lookup_db(const struct ovsdb_jsonrpc_session *s,
+ const struct jsonrpc_msg *request,
+ struct jsonrpc_msg **replyp)